FormsAuthentication.SetAuthCookie Method (String, Boolean)
Assembly: System.Web (in system.web.dll)
public static function SetAuthCookie ( userName : String, createPersistentCookie : boolean )
The name of an authenticated user. This does not have to map to a Windows account.
true to create a durable cookie (one that is saved across browser sessions); otherwise, false.
The SetAuthCookie method adds a forms-authentication ticket to either the cookies collection or the URL if CookiesSupported is false. The forms-authentication ticket supplies forms-authentication information to the next request made by the browser. With forms authentication, you can use the SetAuthCookie method when you want to authenticate a user but still retain control of the navigation with redirects.