View Single Post
  #1 (permalink)  
Old December 27th, 2008, 10:38 AM
hertendreef hertendreef is offline
Friend of Wrox
 
Join Date: Apr 2006
Location: , , .
Posts: 160
Thanks: 0
Thanked 0 Times in 0 Posts
Default using cookie with client computer

Hi,

I organise surveys on internet. So i send a cookie to the clientcomputer as check and avoiding a second attempt on the same survey.
I know this is not 100% sure (one can delete the cookie or disable javascript).
The code is here below and works:

Protected Sub submit_Click(ByVal sender As Object, ByVal e As
System.EventArgs)

If Not Request.Cookies("enq") Is Nothing Then
Dim enq As String
enq = Server.HtmlEncode(Request.Cookies("enq").Value)
Page.ClientScript.RegisterClientScriptBlock(Me.Get Type(), "myscript", _
" alert(already filled.');" & _
" window.location.href='http://xye.sd.sd/';", True)
Else
Response.Cookies("enq").Value = "1"
End If
....

I can see the cookie in C:\Documents and Settings\myaccount\Local Settings\Temporary Internet Files

But i visited recently a website also with a survey. I filled it, then made the whole Temporary Internet Files directory empty to be sure, i closed the
browser and then i went back to the same site, i tried to fill the survey a second time, but i got the message "you have already ..." .

I even started Firefox on the same client computer and there too i couldn't fill the survey. And i also disconnected my internet connection and reconnected (with a new IP) but still same message.

My conclusion is that there must be another cookie placed in another location.

Can someone tell me what i can do more than my code ( can i redirected another cookie in another place?) or does it exist another way to prevent
the second attempt?

Thanks
H.