>>Hi,
>>
>>I need to set a session variable when a user logs in.
>>
>>in my Global.asx I am trying this in the Application_AuthenticateRequest
>>
>>
HttpContext.Current.Session["SelectedClient"] = null;
>>
>>but I get an "object reference not set to an instance of an object" error.
>>
>>HttpContext.Current.Session is null at this time.
>>
>>When would the session exist so that I can set a variable?
>
>Try checking in Application_AuthorizeRequest() instead (or maybe Application.PostAuthenticateRequest()).....
Thanks, I'll check it out. I got it to work in the Page_PreInit() for now.