Session timeout kentico web part

web dev asked on October 5, 2018 18:29

hello kentico dev i try to apply a custom web part to search for company code and i set the session and but the problem is sessiontimeout here is my code but its not working is ther any methode to set time out for session

   Session["CompanyCode"] = CompanyCode.Text;
   SessionHelper.SessionTimeout = 10;

Correct Answer

Zach Perry answered on October 5, 2018 18:41

What are you trying to accomplish?

Are you trying to change the timeout period? According to the documentation that property doesn't change that.

I think you have to set the timeout in the web config: <sessionState mode="InProc" timeout="5" />

Or you can do it in C#: Session.Timeout = 5; //Minutes

If you want to do the current session you should be able to do something like this: HttpContext.Current.Session.Timeout = 5;

0 votesVote for this answer Unmark Correct answer

Recent Answers

web dev answered on October 6, 2018 20:25

thanks Zach Perry

0 votesVote for this answer Mark as a Correct answer

   Please, sign in to be able to submit a new answer.