Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>To perform a login using the FormsAuthentication module, you may want to just use the <a href="http://msdn.microsoft.com/en-us/library/system.web.security.formsauthentication.redirectfromloginpage%28v=vs.80%29.aspx" rel="nofollow">RedirectFromLoginPage</a> static method, which, under the covers:</p> <ol> <li>prepares the authentication token;</li> <li>encrypts it;</li> <li>adds it to the cookie collection of the response;</li> <li>performs the redirect to the required page (or the default one, as per your web.config).</li> </ol> <p>Here is a short prototype for your handler:</p> <pre><code>public void ProcessRequest(HttpContext context) { // TODO: Determine the user identity var username = context.Request.QueryString["username"]; FormsAuthentication.RedirectFromLoginPage(username, true); } </code></pre> <p>If you are not comfortable by the way this method performs its job, you may do each activity in a manual way:</p> <ol> <li>prepare a <a href="http://msdn.microsoft.com/en-us/library/system.web.security.formsauthenticationticket%28v=vs.80%29.aspx" rel="nofollow">FormsAuthenticationTicket</a> with the user name;</li> <li>encrypt it by way of the <a href="http://msdn.microsoft.com/en-us/library/system.web.security.formsauthentication.encrypt%28v=vs.80%29.aspx" rel="nofollow">Encrypt</a> method;</li> <li>add it to the <a href="http://msdn.microsoft.com/en-us/library/system.web.httpresponse.cookies%28v=vs.80%29.aspx" rel="nofollow">response Cookies</a>;</li> <li>issue a <a href="http://msdn.microsoft.com/en-US/library/system.web.httpresponse.redirect%28v=vs.80%29.aspx" rel="nofollow">redirect</a>.</li> </ol>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload