Answered by:
Random logout Issue , IIS 6

Question
-
User-1159718630 posted
Hello,
I have deployed a web application on a windows server 2003 (IIS 6).
The issue am having is that i get random logouts. To be able to view a page , i first check session , if the session for the variable userid...if session is not null, i load the page, else i redirect to the login page.
I have noticed that very often, the session for the userid is not retained. On login i create this session, and am able to browse and gets on the different pages many times and suddenly i get this problem of nt keeping session.
Have anyone got this problem on IIS 6 ?
I need to find a soln for this asap. Please do post any workaround you might have.
Regards,
Shaimaa
Thursday, December 15, 2011 12:47 AM
Answers
-
User612574037 posted
Hi,
When you redirect to another page after session variable you may lost the session value. You can try to use the Response.Redirect("~/Default.aspx",false) to solve the problem. You can refer to the below link for more details.
- Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
Wednesday, December 21, 2011 8:11 AM
All replies
-
User-1971614856 posted
Use
<sessionState timeout="20" />
in web.config under <system.web>
Here 20 is minutes for session timeout.
Thursday, December 15, 2011 1:13 AM -
User-786828155 posted
Hi,
Please try using fiddler to see if session_id is being transferred and also see if the session timeout is defined in web.config. Please try this too
Open the IIS, click on the Application Pools, Select the Application pool for your application.
Right Click on that, Select Properties.
In the Performance tab, Set the idle timeout as your desire.
Thanks,
Yuvika
Thursday, December 15, 2011 1:35 AM -
User-1159718630 posted
Hi,
Thanks for the help...I've tried this already but it does not work. I still get the issue .
Thursday, December 15, 2011 1:37 AM -
User-786828155 posted
You are using what type of authentication?. If its form authentication please verify you are updating the ticket for the user.
Yuvika
Thursday, December 15, 2011 1:46 AM -
User-1355816385 posted
Is your website hosted on a single server ? Check webfarm and web garden
Thursday, December 15, 2011 1:52 AM -
User-1159718630 posted
Hello Yuvika,
I have used Elmah to log the errors (if any) and as i mentioned there is no errors from the code, simply at certain point, the session["userid"] becomes null...and thus it redirect to login page.
Concerning the IIS and setting idle timout, i've done that as well.
Regards,
Shaimaa
Thursday, December 15, 2011 2:08 AM -
User-786828155 posted
Please visit this link. May be this is helpful for you
http://www.c-sharpcorner.com/uploadfile/technoNet/session-timeouts-causes-and-remedies/
Thanks,
Yuvika
Thursday, December 15, 2011 2:10 AM -
User-1159718630 posted
Concerning form authentication, no am nt using it. I have created a simple login page and i have my own functions to authenticate the user.
Thursday, December 15, 2011 2:10 AM -
User-1159718630 posted
Hello Abhijit
yes it is on a single server...ok i will check webfarm and webgarden right now..
To be honest, am nt familiar with these. If u can tell me how this can be linked to the problem am having, will be nice.
thanks
Thursday, December 15, 2011 2:12 AM -
User612574037 posted
Hi,
When you redirect to another page after session variable you may lost the session value. You can try to use the Response.Redirect("~/Default.aspx",false) to solve the problem. You can refer to the below link for more details.
- Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
Wednesday, December 21, 2011 8:11 AM -
User1570164458 posted
A web farm contains multiple web servers, the requests are processed by each web server based on the load and number of request.
A webfarm is used for load balancing. The first request can be from Web Server 1 and the second might come from Web Server 2.... depending on the number of web servers on your web farm.
Sessions (stored on the web server) obviously do not work on web farm because all the requests need not come from the same server.
Tuesday, March 20, 2012 8:46 AM