Re: get returning user for forms auth?



On May 10, 12:24 am, Sergei Shelukhin <realg...@xxxxxxxxx> wrote:
Hi. I have the following scenario; user logs in using standard login
control for forms auth, I validate his credentials against the
database, optionally make the cookie persistent and then set some
application-specific session variables for that user.

Now, when the user closes the browser and returns to the site again
the next day, he will be authenticated if he had logged in previously
w/the checkbox check.
The problem is, I need to initialize the session variables for that
user again when he reenters the site; I pondered checking auth cookie
manually, decrypting the ticket and getting username etc; however that
doesn't seem right. How do I find out that authenticated user is re-
entering the site (in Session_Start event I guess)?

protected void Session_Start(object sender, EventArgs e)
{
if (Request.IsAuthenticated)
{
Session["CurrentUser"] = User.Identity.Name;
}
}

.



Relevant Pages

  • get returning user for forms auth?
    ... application-specific session variables for that user. ... user again when he reenters the site; I pondered checking auth cookie ... How do I find out that authenticated user is re- ...
    (microsoft.public.dotnet.framework.aspnet.security)
  • Re: logging off (without getting page when click on back )
    ... If you are using Forms Authentication, ... Auth use so a new session will be started whenever ... If you are relying on session variables only, ... very secure mechanism to handle authentication. ...
    (microsoft.public.dotnet.framework.aspnet.security)
  • PEAR Auth - check on each page
    ... On the login page I create and object of type Auth ... Now at the top of the each authorised-only page I create a new Auth object ... And I take it that these session variables can then be checked by any old ...
    (comp.lang.php)