472,954 Members | 1,734 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,954 software developers and data experts.

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
2 1463
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
by: Christoph Pieper | last post by:
Hi, we've the following problem : We have an asp-application which sets the cookie on first login. The cookie will never be touched during user access. The user can work the whole day, but...
0
by: Sebastien Roeckel | last post by:
Hello I have a problem with the authentication cookie timeout in a forms authentication. I've developed a Web application that uses forms authentication. My web.config is configured for the...
0
by: Kepler | last post by:
I'm testing very basic FormsAuthentication and having trouble with non-persistent cookies. Once authenticated with a non-persistent cookie, if I leave the browser alone for 30 minutes,...
0
by: briand | last post by:
I have the following code in my base page to redirect to a session timeout page. override protected void OnInit(EventArgs e) { base.OnInit(e); //It appears from testing that the Request...
2
by: Keith Patrick | last post by:
I'm trying to programmatically post data to another page within my ASP.Net app. Not POSTing is not an option (I can't store this data in my session, context, hidden fields, or anything else...I've...
15
by: Edwin Knoppert | last post by:
I have searched but info is limitted. In my test app i used a non persistant cookie for forms authentication. slidingExpiration is set to true On run and close and rerun the login remains ok....
7
by: Adam Bates | last post by:
Hello, I have a problem, I have been using Cookie Authentication on the 1.1 framework for around 3 months, when I moved the site internally within my hosting company from a server with 1.1...
3
by: Dan | last post by:
Hi, I am trying to refresh the cookie to make sure the timeout is reset by simply calling a blank page on my site. I am doing this because I have an external site hosted in my web that isn't...
5
by: SJ | last post by:
Hi, In my website, i have a cookie that allows the user to remain logged in for upto 90days. So I'm setting the cookie expiration time to 90 days in the future from the time the user logs in....
0
by: lllomh | last post by:
Define the method first this.state = { buttonBackgroundColor: 'green', isBlinking: false, // A new status is added to identify whether the button is blinking or not } autoStart=()=>{
0
by: Mushico | last post by:
How to calculate date of retirement from date of birth
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 4 Oct 2023 starting at 18:00 UK time (6PM UTC+1) and finishing at about 19:15 (7.15PM) The start time is equivalent to 19:00 (7PM) in Central...
0
by: Aliciasmith | last post by:
In an age dominated by smartphones, having a mobile app for your business is no longer an option; it's a necessity. Whether you're a startup or an established enterprise, finding the right mobile app...
3
NeoPa
by: NeoPa | last post by:
Introduction For this article I'll be using a very simple database which has Form (clsForm) & Report (clsReport) classes that simply handle making the calling Form invisible until the Form, or all...
1
by: Teri B | last post by:
Hi, I have created a sub-form Roles. In my course form the user selects the roles assigned to the course. 0ne-to-many. One course many roles. Then I created a report based on the Course form and...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 1 Nov 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM) Please note that the UK and Europe revert to winter time on...
3
by: nia12 | last post by:
Hi there, I am very new to Access so apologies if any of this is obvious/not clear. I am creating a data collection tool for health care employees to complete. It consists of a number of...
0
NeoPa
by: NeoPa | last post by:
Introduction For this article I'll be focusing on the Report (clsReport) class. This simply handles making the calling Form invisible until all of the Reports opened by it have been closed, when it...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.