Re: Cookies
From: wl (sorry_at_nospam.nospam)
Date: 07/26/04
- Next message: Hans Kesting: "AutoPostback and validators"
- Previous message: Bart Schelkens: "Hiding controls"
- In reply to: Jos: "Re: Cookies"
- Next in thread: John Sivilla: "RE: Cookies"
- Messages sorted by: [ date ] [ thread ]
Date: Mon, 26 Jul 2004 11:59:56 +0200
On Microsoft MSDN pages you can vote for the usefulness of documents.
They also check whether you vote just once: I did some testing and it seems
they use a combination of IP and useragent name.
With the same IP and a different useragent you can still vote.... And also
with the same useragent and a different IP.
Wim
"Jos" <josnospambranders@fastmail.fm> wrote in message
news:ekdyTthcEHA.3988@tk2msftngp13.phx.gbl...
> Saber wrote:
> > I want to prevent users from voting more than 1 time in a simple poll.
> > I tried:
> >
> > Session.Timeout = 40
> >
> > Dim objCookie As HttpCookie
> > objCookie = New HttpCookie("before", "voted")
> >
> > If Session("before") = "" And Request.Cookies("before") Is Nothing
> > Then Session("before") = "voted: true"
> > Response.Cookies.Add(objCookie)
> > ...
> >
> > But the If block runs again when I close and open page, then
> > re-submit the form, I mean Request.Cookies("before") Is Nothing
> > always is Nothing!
> > why? what I've to do?
>
> You need to set an expiration time to the cookie to make it
> a persistent cookie.
> If you don't, the cookie will be a session cookie, and it
> will expire with the session.
>
> objCookie.Expires = Date.Now().AddDays(30)
>
> --
>
> Jos
>
>
- Next message: Hans Kesting: "AutoPostback and validators"
- Previous message: Bart Schelkens: "Hiding controls"
- In reply to: Jos: "Re: Cookies"
- Next in thread: John Sivilla: "RE: Cookies"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|