Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Session timeout not working

Reply
Thread Tools

Session timeout not working

 
 
=?Utf-8?B?aG4=?=
Guest
Posts: n/a
 
      01-28-2005
I tried to set session timeout =1 minute as seen below in my Web.config but
it didn't work. I also tried to set the timeout in IIS as well and still the
application doesn't time out after 1 minute. Please show me how to set the
timeout setting. Thanks.

<sessionState
mode="StateServer"
stateConnectionString="tcpip=127.0.0.1:42424"
sqlConnectionString="data source=127.0.0.1;Trusted_Connection=yes"
cookieless="false"
timeout="1"
/>
 
Reply With Quote
 
 
 
 
Alvin Bruney [MVP]
Guest
Posts: n/a
 
      01-29-2005
how do you know the session didn't time out? what tests are you running to
show that it didn't time out? If you put a break point in the session
timeout event, does it hold?

--
Regards,
Alvin Bruney

[Shameless Author plug]
The Microsoft Office Web Components Black Book with .NET
Now Available @ www.lulu.com/owc
----------------------------------------------------------


"hn" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
>I tried to set session timeout =1 minute as seen below in my Web.config but
> it didn't work. I also tried to set the timeout in IIS as well and still
> the
> application doesn't time out after 1 minute. Please show me how to set the
> timeout setting. Thanks.
>
> <sessionState
> mode="StateServer"
> stateConnectionString="tcpip=127.0.0.1:42424"
> sqlConnectionString="data
> source=127.0.0.1;Trusted_Connection=yes"
> cookieless="false"
> timeout="1"
> />



 
Reply With Quote
 
 
 
 
=?Utf-8?B?aG4=?=
Guest
Posts: n/a
 
      01-31-2005
On my asp.net pages I use session for authentication. If session ends, the
user should be logged out and redirected to some other page. Currently the
user is only logged out after 20 minutes or so. when I set timeout=1, the
user is still able to navigate the authenticated pages after 1 minute of
being inactive.

"Alvin Bruney [MVP]" wrote:

> how do you know the session didn't time out? what tests are you running to
> show that it didn't time out? If you put a break point in the session
> timeout event, does it hold?
>
> --
> Regards,
> Alvin Bruney
>
> [Shameless Author plug]
> The Microsoft Office Web Components Black Book with .NET
> Now Available @ www.lulu.com/owc
> ----------------------------------------------------------
>
>
> "hn" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...
> >I tried to set session timeout =1 minute as seen below in my Web.config but
> > it didn't work. I also tried to set the timeout in IIS as well and still
> > the
> > application doesn't time out after 1 minute. Please show me how to set the
> > timeout setting. Thanks.
> >
> > <sessionState
> > mode="StateServer"
> > stateConnectionString="tcpip=127.0.0.1:42424"
> > sqlConnectionString="data
> > source=127.0.0.1;Trusted_Connection=yes"
> > cookieless="false"
> > timeout="1"
> > />

>
>
>

 
Reply With Quote
 
Alvin Bruney [MVP]
Guest
Posts: n/a
 
      01-31-2005
You have a logic error. In each page load, you need to check session to find
out if the user is still authenticated.
Consider:
if(Session["LOGIN"] == null)
redirect to login page

In your case, when the timeout occurs and you redirect, you are using a new
session. But since you don't check if it is a new session, it appears that
the user is using the old session. Makes sense?

--
Regards,
Alvin Bruney [MVP ASP.NET]

[Shameless Author plug]
The Microsoft Office Web Components Black Book with .NET
Now Available @ http://tinyurl.com/27cok
----------------------------------------------------------


"hn" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> On my asp.net pages I use session for authentication. If session ends, the
> user should be logged out and redirected to some other page. Currently the
> user is only logged out after 20 minutes or so. when I set timeout=1, the
> user is still able to navigate the authenticated pages after 1 minute of
> being inactive.
>
> "Alvin Bruney [MVP]" wrote:
>
>> how do you know the session didn't time out? what tests are you running
>> to
>> show that it didn't time out? If you put a break point in the session
>> timeout event, does it hold?
>>
>> --
>> Regards,
>> Alvin Bruney
>>
>> [Shameless Author plug]
>> The Microsoft Office Web Components Black Book with .NET
>> Now Available @ www.lulu.com/owc
>> ----------------------------------------------------------
>>
>>
>> "hn" <(E-Mail Removed)> wrote in message
>> news:(E-Mail Removed)...
>> >I tried to set session timeout =1 minute as seen below in my Web.config
>> >but
>> > it didn't work. I also tried to set the timeout in IIS as well and
>> > still
>> > the
>> > application doesn't time out after 1 minute. Please show me how to set
>> > the
>> > timeout setting. Thanks.
>> >
>> > <sessionState
>> > mode="StateServer"
>> > stateConnectionString="tcpip=127.0.0.1:42424"
>> > sqlConnectionString="data
>> > source=127.0.0.1;Trusted_Connection=yes"
>> > cookieless="false"
>> > timeout="1"
>> > />

>>
>>
>>



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Session Timeout problems-web.confg session state and IIS session s =?Utf-8?B?Um9iSEs=?= ASP .Net 4 04-11-2007 04:52 PM
Timeout::timeout and Socket timeout Mark Probert Ruby 1 10-06-2004 09:30 AM
Re: ASPX Page Timeout - Session Timeout bruce barker ASP .Net 2 07-20-2004 08:39 PM
Session contents lost despite Session.Timeout = 3000; and <sessionState mode="InProc" cookieless="false" timeout="300"> Carpe Diem ASP .Net 3 02-23-2004 07:10 PM
web.config session timeout and forms authentication timeout Do ASP .Net 2 11-23-2003 02:27 PM



Advertisments