Click here to Skip to main content
15,894,180 members
Please Sign up or sign in to vote.
3.00/5 (1 vote)
See more:
Hello,
I am having a session variable called "UserId" and Session starts when a user Login. Problem is, Value stored in Session becomes "0" after some time.
Thanks in advance.
Posted
Comments
Ed Nutting 9-Apr-12 2:52am    
This is called Session Timeout and can be changed. Please research this more in Google.
Hope this helps,
Ed

Look at this document: MSDN: ASP.NET Session State Overview[^] - it talks about teh Session State Timeout about half way down.
 
Share this answer
 
Deepak , just have a look at the web.config..Whether the timeout has mentioned in <sessionstate>....
if not add this inside the

system.web
(sessionstate cookieless="false" mode="InProc" timeout="15")

Change The timeout A/C To Your Requirement...
 
Share this answer
 
v2
Comments
Deepak Manuja 14-Apr-12 0:36am    
Thanks it works...
sumit kausalye 8-Nov-12 23:45pm    
inthis case what is 15? 15 min or secs???
Nandakishore G N 9-Nov-12 1:45am    
15 mins...pa...

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900