Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ASP.NET Can you set session timeout value in C#

Tags:

asp.net

I want to set the session timeout in code so it can come from a configurable value.

Can I just do this in global.asax?

Session.Timeout = value;

like image 311
AJM Avatar asked Dec 28 '22 02:12

AJM


1 Answers

to change session timeout write this code in your web.config file

or you can also set this in global.asax file as

Session.Timeout = 60 ; // in Session.Start() event

it will increase your session expire time .

like image 85
safi Avatar answered Jan 14 '23 15:01

safi