Click here to Skip to main content
15,886,095 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:
Hi Team,

When actively working in the system the User should not timeout. Timeout should only occur if no activity for 30 minutes.

the project is developed with MVC Razor environment.Can you help me out.

Waiting for your prompt reply.

Thanks,
Sayed.

What I have tried:

In web.config file I have tried using this code but after 30 minutes session expired while user is active(making request) on web site.

1. first time

<sessionState mode="InProc" regenerateExpiredSessionId="true" timeout="30" />

2.second time

<sessionState mode="InProc" timeout="30" />

can you please look on this and provide me your solution.
Posted
Updated 22-May-17 4:01am
v2
Comments
Suvendu Shekhar Giri 16-May-17 5:47am    
What is the session timeout value you have in the web.config?
Member 10155611 16-May-17 5:54am    
Session time 30 mnts
F-ES Sitecore 16-May-17 5:51am    
That's how it should work, if it doesn't work then there is an issue with your config\your hosting\or what you believe the definition of "activity" is.
ZurdoDev 16-May-17 10:38am    
It already works that way. What's the problem?

1 solution

Perhaps your web.config has an error (e.g. sessionState node is not inside the system.web node)? Or value is being set in code elsewhere? Since I typically have session time-outs based on role, I set timeouts in the Global.asax file during the session's start event. Maybe try and set the value there? i.e.
C#
void Session_Start(object sender, EventArgs e)
{
    System.Web.HttpContext.Current.Session.Timeout = 60; // sixty minutes
}
 
Share this answer
 

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