Cookie does not seem to timeout

M

Martin Dew

Hi,

I am using ASP.Net for a website, I use the following code;

<authentication mode="Forms">
<forms name=".ADASTRATEAROUNDS" loginUrl="login.aspx"
protection="All" timeout="30" path="/">

</forms>

</authentication>

I authenticate the user from a database, etc, this all works fine, however
it does not ever appear to time out the cookie. This has been tested on
numerous machines, both with ie and firefox.

I want the cookie to timeout after 30 minutes, so that the user is
redirected to login next time they visit the site (normally after 24hours),
at present when they next visit it is remembering the last cookie and not
prompting them to login.

Any help or pointers would be gratefully received.

T.I.A

Martin
 
B

Brock Allen

In the code where the user is logged in, FormsAuthentication.RedirectFromLoginPage
or FormsAuthentication.SetAuthCookie should be the method used. The 3rd bool
parameter indicates if a persistent cookie should be used. If the cookie
is persistent, then it will not timeout. Perhaps this is the issue?
 
M

Martin Dew

Isn't it easy when you know how ! Thanks very much for pointing that out,
been doing my head in trying to work it out..

Regards

Martin
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,764
Messages
2,569,567
Members
45,041
Latest member
RomeoFarnh

Latest Threads

Top