ASP.NET

Moderators: None (Apply to moderate this forum)
Number of threads: 1727
Number of posts: 3292

This Forum Only
Post New Thread
Single Post View       Linear View       Threaded View      f

Report
What to do when session is getting expired frequently Posted by rahulrrathi on 11 Jan 2010 at 12:20 AM
Hi

I have one application built in ASP.NET.

On login page I have taken user id and stored it in one Session Variable Session["user_id"].

I am using it throught the application as we want to know that which user has added that particular record.

We are storing added by field in every table of database.
Many users get logged in in the system at a particular time.

Sometimes the session gets expired automatically and we does not get the Session["user_id"].

It gives the following error and comes to the login page as we have redirected to login page when session expires.

System.NullReferenceException: Object reference not set to an instance of an object.

We have given Session TimeOut 120 minutes in web.config but session is getting expired frequently.

Can any one tell what can I do so that Session does not get expire before 120 minutes.

Help is greatly appreciated.

Thanks and Regards,
Rahul Rathi
Report
Re: What to do when session is getting expired frequently Posted by dineshmvpa on 11 Jan 2010 at 11:07 PM
Can you please give more information about this.
is it in production server or in your local IIS?
if in production server it is web farm or garden?

which session state ytou are mentioned in web.config?
inproc or some other
Report
Re: What to do when session is getting expired frequently Posted by rahulrrathi on 12 Jan 2010 at 1:56 AM

Hi
we are using IIS.
Session state in web.config is "InProc".

Thanks
Rahul
Report
This post has been deleted. Posted by rahulrrathi on 12 Jan 2010 at 1:59 AM
This post has been deleted.
Report
Re: What to do when session is getting expired frequently Posted by PassHours on 26 May 2010 at 2:30 PM
What version of IIS you are using and what version of .net you are using for development.

Set the session state in web server IIS 6.0.

From VS2008 onwards there is an enhancement like the session timeout setting in web server IIS overrides the session timeout setting in web.config. This is basically implemented for security purpose

Please double check !!

PassHours
========================================================
We make a living by what we get, but we make a life by what we give.
::: Winston Churchill :::



 

Recent Jobs

Official Programmer's Heaven Blogs
Web Hosting | Browser and Social Games | Gadgets

Popular resources on Programmersheaven.com
Assembly | Basic | C | C# | C++ | Delphi | Flash | Java | JavaScript | Pascal | Perl | PHP | Python | Ruby | Visual Basic
© Copyright 2011 Programmersheaven.com - All rights reserved.
Reproduction in whole or in part, in any form or medium without express written permission is prohibited.
Violators of this policy may be subject to legal action. Please read our Terms Of Use and Privacy Statement for more information.
Operated by CommunityHeaven, a BootstrapLabs company.