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.
source
share