Forum Discussion

gauravk9's avatar
gauravk9
Copper Contributor
Nov 19, 2024

How to increase session timeout

Hello Everyone,

I am working on .NET framework 4.8 with a MVC web application.
To login I am using MFA with microsoft's openid-configuration method.

When I create FormsAuthenticationTicket and try to set session timeout as per my requirement but it doesn't work. See the sample code as below 

FormsAuthenticationTicket ticket1 = new FormsAuthenticationTicket(

1, // version

adminEmail, // get username from the form

DateTime.Now, // issue time is now

DateTime.Now.AddDays(365), 

true, // cookie is not persistent

"XXXXX" // role assignment is stored in userData

 );

But it is not working properly, it gets timeout within 15 mins

No RepliesBe the first to reply

Resources