Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
GetAuthCookie Method (String, Boolean, String)
Collapse the table of content
Expand the table of content

FormsAuthentication.GetAuthCookie Method (String, Boolean, String)

Creates an authentication cookie for a given user name. This does not set the cookie as part of the outgoing response.

Namespace: System.Web.Security
Assembly: System.Web (in system.web.dll)

public static HttpCookie GetAuthCookie (
	string userName,
	bool createPersistentCookie,
	string strCookiePath
)
public static HttpCookie GetAuthCookie (
	String userName, 
	boolean createPersistentCookie, 
	String strCookiePath
)
public static function GetAuthCookie (
	userName : String, 
	createPersistentCookie : boolean, 
	strCookiePath : String
) : HttpCookie
Not applicable.

Parameters

userName

The name of the authenticated user.

createPersistentCookie

true to create a durable cookie (one that is saved across browser sessions); otherwise, false.

strCookiePath

The Path of the authentication cookie.

Return Value

An HttpCookie that contains encrypted forms-authentication ticket information.

Windows 98, Windows Server 2000 SP4, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

The Microsoft .NET Framework 3.0 is supported on Windows Vista, Microsoft Windows XP SP2, and Windows Server 2003 SP1.

.NET Framework

Supported in: 3.0, 2.0, 1.1, 1.0

Community Additions

ADD
Show:
© 2015 Microsoft