Solved

How do I set a session timer / timeout in C# codebehind?

Posted on 2014-09-25
4
2,163 Views
Last Modified: 2014-10-06
Are there any examples that I can see here or be pointed to to show how to set the session timeout for my web application in the code behind? (C#)?
0
Comment
Question by:mikesExpertExchange
  • 2
4 Comments
 
LVL 25

Expert Comment

by:apeter
ID: 40346825
You can set the timeout in the web.config or in the code. Please see more details in this link, http://msdn.microsoft.com/en-us/library/system.web.sessionstate.httpsessionstate.timeout(v=vs.110).aspx
0
 
LVL 1

Author Comment

by:mikesExpertExchange
ID: 40346880
@apeter: that shows me and example for the web.config and that helps. I also need an example in C#?
0
 
LVL 80

Accepted Solution

by:
David Johnson, CD, MVP earned 500 total points
ID: 40348109
int iTimeout = 10; // 10 minutes
HttpSessionState.Timeout  = iTimeout;
0
 
LVL 1

Author Closing Comment

by:mikesExpertExchange
ID: 40364097
Thank you.
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Just a quick little trick I learned recently.  Now that I'm using jQuery with abandon in my asp.net applications, I have grown tired of the following syntax:      (CODE) I suppose it just offends my sense of decency to put inline VBScript on a…
Exception Handling is in the core of any application that is able to dignify its name. In this article, I'll guide you through the process of writing a DRY (Don't Repeat Yourself) Exception Handling mechanism, using Aspect Oriented Programming.
Email security requires an ever evolving service that stays up to date with counter-evolving threats. The Email Laundry perform Research and Development to ensure their email security service evolves faster than cyber criminals. We apply our Threat…

789 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question