ASP.Net MVC3 FormsAuthentication overall logged-in event -
i have asp.net mvc3 app. when login action called, use membershipprovider validate user , formsauthentication set cookie.
additionally, info user database , store in session.
when user subsequently visits site, they're authenticated via cookie, , i'm looking somewhere hook can fetch info user database again.
is httpapplication.authorizerequest() best place this? called every request hoping there use indicated user had been authenticated - either explicitly after logging in or when they're authenticated automatically.
there several events triggered on every request, httpapplication.authorizerequest()
should work.
in order fetch database logged in users, can check name
property of user.identity
gets set once user authenticates:
if(!string.isempty(user.identity.name)) { //make call database }
Comments
Post a Comment