Nick Rolando
Nick Rolando

Reputation: 26157

setting a timeout using a manually created forms authentication ticket

The constructors for manually creating FormsAuthenticationTicket objects force us to set an "expiration" value, and this value overrides the "timeout" setting in web.config in my tags, which is not what I want, because now the user doesn't timeout. The "session" just expires at the given time.

I need to manually create my ticket for UserData reasons, and it is just the way I decided to build my app. I guess I could spend a whole lot of time and redo the way my app. authorizes, and store the "userdata" elsewhere... but this seems extremely tedious for something so small..

Is there anyway to manually create an Auth Ticket and still maintain timeout settings?! And by timeout, I mean resetting the timer on user activity. Not a fixed timeout! Please help!

Upvotes: 2

Views: 1295

Answers (1)

gbs
gbs

Reputation: 7266

If you set the slidingExpiration="true" in web.config for your forms element, I think it should take care of resetting the timer even if you pass the expiration date. If you don't create the ticket manually, then the ticket created automatically behind the scene uses the timeout you set in forms element or default(30mins) while creating the FA ticket.

Check the following links:

FAT Timeout

Weird Timeout with custom FA

Upvotes: 1

Related Questions