Sveučilište u Zagrebu  |  Filozofski fakultet  |  Služba za informatiku  |  links

Manual authentication for ASP.NET

(thanks to the http://blog.dmbcllc.com/2009/10/05/forms-authentication-manual-authentication)

 

...since I can’t show you how to authenticate against the service–your implementation will almost certainly be different–we will skip that section. But to set the cookie, all we need to do is to revert to the ASP.NET 1.1 way of setting up the login.

 

    if (Request.QueryString["ReturnUrl"] != null)
    {
        FormsAuthentication.RedirectFromLoginPage(m_tbUsername.Text, persistentCookie);
    }
    else
    {
        FormsAuthentication.SetAuthCookie(m_tbUsername.Text, persistentCookie);
        Response.Redirect("~/");
    }
 

komentare molim ovdje