MembershipService, and 'Remember Me'

  • Thread starter Thread starter Craig Lister
  • Start date Start date
C

Craig Lister

Hi guys,

I am dabbling with a small MVC project for learning, and have un into an issue. I am using the MembershipService for logging in, and it's logging me in nicely. My 'Rememberme' works as well as my Request.IsAuthenticated is picking up that I have logged in before.

However, when I initially log in, it does the Validation on my Username/Password. If that succeeds, I then make a call to get some basic user detils via a method GetUserDetails. That then puts a couple of fields into SessionState, so that my MasterPage can say, 'Welcome <FirstName>'.

However, if I close the browser and reopen, it just says 'Welcome '. So, the user is Authenticated, but I haven't called my GetUserDetails method... because at the moment, I only call it when I click 'Login'. Is there somewhere I can check and call this when the browser is closed and reopened?
 
I am dabbling with a small MVC project for learning, and have un into
an issue. I am using the MembershipService for logging in, and it's
logging me in nicely. My 'Rememberme' works as well as my
Request.IsAuthenticated is picking up that I have logged in before.

However, when I initially log in, it does the Validation on my
Username/Password. If that succeeds, I then make a call to get some
basic user detils via a method GetUserDetails. That then puts a
couple of fields into SessionState, so that my MasterPage can say,
'Welcome<FirstName>'.

However, if I close the browser and reopen, it just says 'Welcome '.
So, the user is Authenticated, but I haven't called my GetUserDetails
method... because at the moment, I only call it when I click 'Login'.
Is there somewhere I can check and call this when the browser is
closed and reopened?

You need to get some logic like:

if authenticated and not details in session then
load details into session
end if

executed before trying to display the details.

The remaining question is just exactly where to put
that logic.

Arne
 
Back
Top