How to set a session variable when a user is automatically logged in through forms authentication?

I use Autodesk Forms (and the built-in Login controls) and let users click the "remember me" checkbox when they log in. When they return to the site, they are automatically registered as expected. Is there an event that I can catch when this happens? I studied the FormsAuthenticationModule.Authenticate event, but I'm not sure if this is the right approach.

+3
source share
3 answers
+7

Session_Start global.asax , , , , . , HttpContext.Current.Session( ). HttpHandler, OnAuthenticate / .

+2

First of all, consider using the Login control, available in 2.0+ (as I recall). There is an Authenticate event that you can handle on this control where you can set your session variable.

In addition, suppose that after authentication, the user goes to some "home page". This way you can set your session variable inside the "home" page. Download the event handler.

0
source

Source: https://habr.com/ru/post/1699395/


All Articles