RE: Cookies
From: John Sivilla (JohnSivilla_at_discussions.microsoft.com)
Date: 07/27/04
- Next message: Tampa .NET Koder: "Re: How to store picture (*.jpg, *.bmp, *.gif) into sql database ?"
- Previous message: xs: "Customized web pages"
- In reply to: Saber: "Cookies"
- Next in thread: John Sivilla: "RE: Cookies"
- Messages sorted by: [ date ] [ thread ]
Date: Mon, 26 Jul 2004 20:43:05 -0700
By default cookies expire when the session expires. In order to persist a cookie for longer than a session, you must explicitly set the expires property to a value in the future.
Hope this helps,
John
"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?
>
>
>
- Next message: Tampa .NET Koder: "Re: How to store picture (*.jpg, *.bmp, *.gif) into sql database ?"
- Previous message: xs: "Customized web pages"
- In reply to: Saber: "Cookies"
- Next in thread: John Sivilla: "RE: Cookies"
- Messages sorted by: [ date ] [ thread ]