Forums
This topic is locked
Using COOKIES to prevent multiple survey submits
Posted 11 Apr 2002 15:37:09
1
has voted
11 Apr 2002 15:37:09 Mitchel Tendler posted:
I built an Online Survey system for a school, the student enteres the CourseCode for the Course they took and they click the Submit button. The survey
comes up and is automatically populated with the Details of the Course, such
as Instructor, Department and so on. Student name and e-mail is OPTIONAL.
The problem is that I have to allow the student to take more than 1 survey,
so that leaves the system open to abuse, they can take more than 1 survey
for the SAME class.
Is there a way to capture the UNIQUE Course Code and put it into a COOKIE
and send it to the students computer, then when they enter a Course Code for
the Survey they want to take, the ASP page will first see if there is a
COOKIE with that Course Code, and if so, bounce them to an Error Type page,
and if the COOKIE does not exsist, let them proceed to the Survey?
I know this will not stop them from going to another Computer, but it does
afford some type of protection. <img src=../images/dmxzone/forum/icon_smile.gif border=0 align=middle>
Or do you have a better suggestion?
Thanks!
Mitch
Replies
Replied 11 Apr 2002 15:45:56
11 Apr 2002 15:45:56 Viktor Farcic replied:
You don't need cookies for this.
Before inserting new record verify if the user already inserted one with the same CourseCode. To do this, just filter the table with their Username and CourseCode and if that table is empty (EOF) then insert the record.
<BLOCKQUOTE id=quote><font size=1 face="Verdana, Arial, Helvetica" id=quote>quote:<hr height=1 noshade id=quote>
I built an Online Survey system for a school, the student enteres the Course
Code for the Course they took and they click the Submit button. The survey
comes up and is automatically populated with the Details of the Course, such
as Instructor, Department and so on. Student name and e-mail is OPTIONAL.
The problem is that I have to allow the student to take more than 1 survey,
so that leaves the system open to abuse, they can take more than 1 survey
for the SAME class.
Is there a way to capture the UNIQUE Course Code and put it into a COOKIE
and send it to the students computer, then when they enter a Course Code for
the Survey they want to take, the ASP page will first see if there is a
COOKIE with that Course Code, and if so, bounce them to an Error Type page,
and if the COOKIE does not exsist, let them proceed to the Survey?
I know this will not stop them from going to another Computer, but it does
afford some type of protection. <img src=../images/dmxzone/forum/icon_smile.gif border=0 align=middle>
Or do you have a better suggestion?
Thanks!
Mitch
<hr height=1 noshade id=quote></BLOCKQUOTE id=quote></font id=quote><font face="Verdana, Arial, Helvetica" size=2 id=quote>
Viktor Farcic
TalkZone Manager
Before inserting new record verify if the user already inserted one with the same CourseCode. To do this, just filter the table with their Username and CourseCode and if that table is empty (EOF) then insert the record.
<BLOCKQUOTE id=quote><font size=1 face="Verdana, Arial, Helvetica" id=quote>quote:<hr height=1 noshade id=quote>
I built an Online Survey system for a school, the student enteres the Course
Code for the Course they took and they click the Submit button. The survey
comes up and is automatically populated with the Details of the Course, such
as Instructor, Department and so on. Student name and e-mail is OPTIONAL.
The problem is that I have to allow the student to take more than 1 survey,
so that leaves the system open to abuse, they can take more than 1 survey
for the SAME class.
Is there a way to capture the UNIQUE Course Code and put it into a COOKIE
and send it to the students computer, then when they enter a Course Code for
the Survey they want to take, the ASP page will first see if there is a
COOKIE with that Course Code, and if so, bounce them to an Error Type page,
and if the COOKIE does not exsist, let them proceed to the Survey?
I know this will not stop them from going to another Computer, but it does
afford some type of protection. <img src=../images/dmxzone/forum/icon_smile.gif border=0 align=middle>
Or do you have a better suggestion?
Thanks!
Mitch
<hr height=1 noshade id=quote></BLOCKQUOTE id=quote></font id=quote><font face="Verdana, Arial, Helvetica" size=2 id=quote>
Viktor Farcic
TalkZone Manager
Replied 11 Apr 2002 16:27:38
11 Apr 2002 16:27:38 Mitchel Tendler replied:
Viktor,
That would be super easy to do, but the Student Name and E-Mail are optional.
That's the way the client want's it.
Thanks!
That would be super easy to do, but the Student Name and E-Mail are optional.
That's the way the client want's it.
Thanks!
Replied 12 Apr 2002 09:47:50
12 Apr 2002 09:47:50 Viktor Farcic replied:
Is there any personal data student must insert? There must be something (username, ID...).
<BLOCKQUOTE id=quote><font size=1 face="Verdana, Arial, Helvetica" id=quote>quote:<hr height=1 noshade id=quote>
Viktor,
That would be super easy to do, but the Student Name and E-Mail are optional.
That's the way the client want's it.
Thanks!
<hr height=1 noshade id=quote></BLOCKQUOTE id=quote></font id=quote><font face="Verdana, Arial, Helvetica" size=2 id=quote>
Viktor Farcic
TalkZone Manager
<BLOCKQUOTE id=quote><font size=1 face="Verdana, Arial, Helvetica" id=quote>quote:<hr height=1 noshade id=quote>
Viktor,
That would be super easy to do, but the Student Name and E-Mail are optional.
That's the way the client want's it.
Thanks!
<hr height=1 noshade id=quote></BLOCKQUOTE id=quote></font id=quote><font face="Verdana, Arial, Helvetica" size=2 id=quote>
Viktor Farcic
TalkZone Manager
Replied 12 Apr 2002 17:54:30
12 Apr 2002 17:54:30 Mitchel Tendler replied:
The 1 UNIQUE item is that they entered in a COURSE_CODE to get to the Survey.
If I could capture the Course Code and enter that value into a Cookie, then I could check for that Course Code on the Survey Page, if the Course Code recorded on the Cookie equals the Course Code they are submitting with the Survey then it would redirect to an Message Page.
Make sense? <img src=../images/dmxzone/forum/icon_smile.gif border=0 align=middle>
When in doubt...reboot!
If I could capture the Course Code and enter that value into a Cookie, then I could check for that Course Code on the Survey Page, if the Course Code recorded on the Cookie equals the Course Code they are submitting with the Survey then it would redirect to an Message Page.
Make sense? <img src=../images/dmxzone/forum/icon_smile.gif border=0 align=middle>
When in doubt...reboot!
Replied 13 Apr 2002 13:50:55
13 Apr 2002 13:50:55 Viktor Farcic replied:
<% Response.Cookies("CourseCode" = Request("COURSE_CODE" %>
Viktor Farcic
TalkZone Manager
Viktor Farcic
TalkZone Manager
Replied 13 Apr 2002 15:39:29
13 Apr 2002 15:39:29 Mitchel Tendler replied:
Thanks vfarcic!
But where in the page do I put the code...in the <HEAD>?
When in doubt...reboot!
But where in the page do I put the code...in the <HEAD>?
When in doubt...reboot!