IT Community - Software Programming, Web Development and Technical Support

Problem in Session TimeOut

This is a discussion on Problem in Session TimeOut within the ASP and ASP.NET Programming forums, part of the Web Development category; Hi there, I'm trying to maintain a session for 10 hours. Below tags are in my web.config file. ...


Go Back   IT Community - Software Programming, Web Development and Technical Support > Web Development > ASP and ASP.NET Programming

Register FAQ Members List Calendar Mark Forums Read
  #1 (permalink)  
Old 09-25-2007, 05:17 AM
S.Vinothkumar S.Vinothkumar is offline
D-Web Genius
 
Join Date: May 2007
Posts: 1,061
S.Vinothkumar is on a distinguished road
Question Problem in Session TimeOut

Hi there,

I'm trying to maintain a session for 10 hours. Below tags are in my web.config file.
Code:
<sessionState mode="InProc" cookieless="false" timeout="600" /> 
<forms loginUrl="login.aspx" timeout="600"></forms>
My problem is the session ends before that 10 hours, but I remain authenticated even after the session expires.

I'm not getting redirected to the login page but I loose my session data. I don't know where I'm doing wrong....
__________________
S.VinothkumaR
Behind me is infinite power,
Before me is Endless Possibility,
Around me is Boundless Opportunity,
Why should I fear!
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 09-25-2007, 10:54 PM
krishnakumar krishnakumar is offline
D-Web Analyst
 
Join Date: May 2007
Posts: 206
krishnakumar is on a distinguished road
Smile Re: Problem in Session TimeOut

Hi Vinoth,

You have to modified the session timeout in IIS. Just do as following.

Right click on the virtual folder, select properties, click Configuration, and go to the Options tab, and the that timeout to 600 as well.

That's it..
__________________
Krishnakumar.S
Beware of Everything -that is un true; stick to the Truth shall succeed slowly but steadily
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 09-27-2007, 12:43 AM
S.Vinothkumar S.Vinothkumar is offline
D-Web Genius
 
Join Date: May 2007
Posts: 1,061
S.Vinothkumar is on a distinguished road
Smile Re: Problem in Session TimeOut

Ya buddy,

It's working...thanx a lot ...
__________________
S.VinothkumaR
Behind me is infinite power,
Before me is Endless Possibility,
Around me is Boundless Opportunity,
Why should I fear!
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 09-27-2007, 03:19 AM
accer accer is offline
D-Web Sr.Programmer
 
Join Date: Sep 2007
Posts: 175
accer is on a distinguished road
Default Re: Problem in Session TimeOut

Finally a cure for one of my all time biggest problems and headaches. Thanks a lot guys, you've been a big help.
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #5 (permalink)  
Old 09-28-2007, 11:58 PM
mobilegeek mobilegeek is offline
D-Web Analyst
 
Join Date: Jun 2007
Posts: 205
mobilegeek is on a distinguished road
Default Re: Problem in Session TimeOut

Strange, because the session setting in IIS options tab has nothing to do with asp.net session state. It is for ASP session state only.

I will guess you lost your session because you're using InProc mode and the app got restarted.
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #6 (permalink)  
Old 09-29-2007, 12:30 AM
krishnakumar krishnakumar is offline
D-Web Analyst
 
Join Date: May 2007
Posts: 206
krishnakumar is on a distinguished road
Smile Re: Problem in Session TimeOut

Well, I would have presumed that it did not matter, but it does. What happens is that if the IIS timeout is shorter than the session timeout in the Web.Config file, you get to a page where the session is no longer valid, though the ASP.NET session does not actually timeout (the user is not redirected to the Login page).
__________________
Krishnakumar.S
Beware of Everything -that is un true; stick to the Truth shall succeed slowly but steadily
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #7 (permalink)  
Old 12-19-2007, 12:56 AM
GDevakii GDevakii is offline
D-Web Sr.Programmer
 
Join Date: Aug 2007
Posts: 138
GDevakii is on a distinguished road
Smile Re: Problem in Session TimeOut

session.setMaxInactiveInterval(60) ;

In this case, the session times out after 1 min.

session.setMaxInactiveInterval(39600) ;

which indicates that the session would be timed out after 11 hours of inactivity.

But, this never happens and even after 11 hours of inactivity I can still use the application.

I have tried setting this to 3600 sec (1 hr)... but it doesnt work here too.

Can somebody tell me why is it so?
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #8 (permalink)  
Old 01-02-2008, 11:42 PM
Mramesh Mramesh is offline
D-Web Sr.Programmer
 
Join Date: Sep 2007
Location: Chennai
Posts: 106
Mramesh is on a distinguished road
Send a message via MSN to Mramesh
Default Re: Problem in Session TimeOut

Hi all, Session is not getting expired.

I am setting a value for session.timeout in codebehind in one of my file but its not getting expired..
Any one plz help me......

I am overwriting the timeout in web.config with the time i want as per my requirement...Actually i am getting that value from database and assigning to session.timeout..and i am keeping idle for that much time eventhough its not getting expired...

In one of my file i am taking as

Code:
Session["TimeOut"] = SessionExpiry;  //Some value which i am getting from database
Session.Timeout = SessionExpiry;

And in Master-Header page i am checking for

Code:
if (Session["TimeOut"] == null)
  {
                       Response.Redirect("Default.aspx");
  }
But its not getting redirected...I checked it for 1min,20 min,30min also but its not getting expired....
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

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

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
copy information from $_SESSION when timeout.? saravanan PHP Programming 0 03-19-2008 09:24 PM
copy information from HttpSession when timeout.? saravanan Java Server Pages (JSP) 0 03-19-2008 09:22 PM
Destroy session using session ID Jeyaseelansarc PHP Programming 1 09-07-2007 07:42 AM
How to check if a session is about to timeout KiruthikaSambandam ASP and ASP.NET Programming 1 08-08-2007 04:25 AM
Session Problem raj PHP Programming 1 07-17-2007 03:54 AM


All times are GMT -7. The time now is 07:10 AM.


Copyright ©2004 - 2007, DiscussWeb. All Rights Reserved.

SEO by vBSEO 3.0.0