Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP.NET 2.0 > ASP.NET 2.0 Professional
Password Reminder
Register
| FAQ | Members List | Search | Today's Posts | Mark Forums Read
ASP.NET 2.0 Professional If you are an experienced ASP.NET programmer, this is the forum for your 2.0 questions. Please also see the Visual Web Developer 2005 forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 2.0 Professional section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
 
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old December 27th, 2008, 10:38 AM
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.
  #2 (permalink)  
Old December 28th, 2008, 12:17 PM
Wrox Author
Points: 13,255, Level: 49
Points: 13,255, Level: 49 Points: 13,255, Level: 49 Points: 13,255, Level: 49
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Oct 2005
Location: Ohio, USA
Posts: 4,104
Thanks: 1
Thanked 64 Times in 64 Posts
Send a message via AIM to dparsons
Default

There could be a few things at play:

1) You did not say if the website you visited required you to 'log in'. If you did then the system is tracking based upon user names and probably not a cookie of some sort.

2) With regard to your IP address, you did not say how you obtained this. For example, if I issue the following commands from a command prompt on my work pc: ipconfig -release then ipconfig -renew I might very well wind up with a different internal IP address, however, my external IP address has not changed. The same secnario holds true if I issue the commands from my home PC since it sits behind a router that is attached to my cable modem. In both cases your internal IP address has changed, your external has not.

I will have to say that one of the aforementioned conditions are true because, typically, a cookie created in IE can not be read by FireFox or vice versa. Further, when you create a cookie, the browser decides where it is placed on the client machine and, as far as I know, this can not be overriden.

Lastly, as you have said, there is no "full proof" poll/survey system and I think you just need to accept it. For example, if you look at www.cnn.com they have a poll on their homepage everyday with a little disclaimer that says "Polls are not scientific" which is a nod to them knowing there is no full proof way to prevent ballot stuffing and the like.

hth.
-Doug
__________________
===============================================
Doug Parsons
Wrox online library: Wrox Books 24 x 7
Did someone here help you? Click on their post!
"Easy is the path to wisdom for those not blinded by themselves."
===============================================
  #3 (permalink)  
Old December 28th, 2008, 12:48 PM
Imar's Avatar
Wrox Author
Points: 72,073, Level: 100
Points: 72,073, Level: 100 Points: 72,073, Level: 100 Points: 72,073, Level: 100
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Utrecht, Netherlands.
Posts: 17,089
Thanks: 80
Thanked 1,587 Times in 1,563 Posts
Default

Rather than clearing the Temporary Internet Files folder manually, try doing it through Internet Explorer: Tools | Internet Options | Delete. There you have an option to delete cookies.

Additionally, get the Internet Explorer Developer Toolbar to look at your existing cookies and get Fiddler to debug the data that gets sent between the browser and the server.

Hope this helps,

Imar
__________________
Imar Spaanjaars
http://Imar.Spaanjaars.Com
Follow me on Twitter

Author of Beginning ASP.NET 4.5 : in C# and VB, Beginning ASP.NET Web Pages with WebMatrix
and Beginning ASP.NET 4 : in C# and VB.
Did this post help you? Click the button below this post to show your appreciation!
  #4 (permalink)  
Old December 28th, 2008, 02:56 PM
Friend of Wrox
 
Join Date: Apr 2006
Location: , , .
Posts: 160
Thanks: 0
Thanked 0 Times in 0 Posts
Default using cookie with client computer

Thanks for replying.

I have not to log in; i'm an anonymous user.
I receive my IP from my provider who probably takes it from a pool of IP.

H.
  #5 (permalink)  
Old December 28th, 2008, 03:45 PM
Wrox Author
Points: 13,255, Level: 49
Points: 13,255, Level: 49 Points: 13,255, Level: 49 Points: 13,255, Level: 49
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Oct 2005
Location: Ohio, USA
Posts: 4,104
Thanks: 1
Thanked 64 Times in 64 Posts
Send a message via AIM to dparsons
Default

Do as Imar has pointed out by clearing your cookies via the browser.
__________________
===============================================
Doug Parsons
Wrox online library: Wrox Books 24 x 7
Did someone here help you? Click on their post!
"Easy is the path to wisdom for those not blinded by themselves."
===============================================
 


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
device connected to client computer hendyhanusin ASP.NET 1.0 and 1.1 Professional 2 March 21st, 2007 11:19 PM
How to get Client Computer Name ramuis78 ASP.NET 2.0 Basics 2 March 11th, 2007 11:48 PM
how to get client computer name ramuis78 ASP.NET 1.0 and 1.1 Basics 1 March 11th, 2007 10:21 AM
how to instal font at client computer BurhanKhan Javascript 4 April 28th, 2004 05:48 AM



All times are GMT -4. The time now is 04:44 AM.


Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.