467,188 Members | 1,476 Online
Bytes | Developer Community
Ask Question

Home New Posts Topics Members FAQ

Post your question to a community of 467,188 developers. It's quick & easy.

Cookie does not seem to timeout

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
Nov 19 '05 #1
  • viewed: 1366
Share:
2 Replies
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?

-Brock
DevelopMentor
http://staff.develop.com/ballen
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


Nov 19 '05 #2
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

On Mon, 13 Jun 2005 06:32:37 -0700, Brock Allen wrote:
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?

-Brock
DevelopMentor
http://staff.develop.com/ballen
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

Nov 19 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

7 posts views Thread by Christoph Pieper | last post: by
reply views Thread by Sebastien Roeckel | last post: by
reply views Thread by briand | last post: by
2 posts views Thread by Keith Patrick | last post: by
15 posts views Thread by Edwin Knoppert | last post: by
7 posts views Thread by Adam Bates | last post: by
3 posts views Thread by Dan | last post: by
5 posts views Thread by SJ | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.