Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Set Session Variable when user logs in
Message
De
27/07/2016 07:57:38
 
 
À
27/07/2016 02:10:06
Information générale
Forum:
ASP.NET
Catégorie:
Autre
Versions des environnements
Environment:
C# 4.0
Application:
Web
Divers
Thread ID:
01638667
Message ID:
01638728
Vues:
62
>>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.
Frank.

Frank Cazabon
Samaan Systems Ltd.
www.samaansystems.com
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform