PDA

View Full Version : Session.Timeout Issues


hughesmi
01-22-2010, 09:58 AM
I m using login function in my site with session. This session of mine gets expired after few minutes irrespective of that user has logged out or not. I know the default is 20 mins on IIS. I have tried this and it dosent work.

My code on each page is:


<%
Session.Timeout=30 ' Set sesction to 30 Mins.
IF Session("MySessionVerb") = False THEN ' declare that current user is validated
Response.Redirect "www.whatIwant.com"

ELSE ' If no session found then show normal
%>


Has anyone got a better way to keep the session vaild longer?

Just an after thought - I found this create a background JavaScript process in the browser that sends regular heartbeats to the server.

http://codingforums.com/showthread.php?t=70925

MIke

Old Pedant
01-22-2010, 09:19 PM
It's possible that some page on your site is changing the timeout and you aren't aware of it.

But there's nothing magic about 20 or 30 minutes. On one intranet site I work on, we set the timeout to 1439 (24 hours minus one minute) and it works fine.

hughesmi
01-22-2010, 09:37 PM
Good point! I need to fix this - been workin on a fix for most of the day

Thanks!