Rolosoft Documented Class Library
Encode Method (cookie)
NamespacesRolosoft.WebControlsCookieSecureEncode(HttpCookie)
Encodes a cookie with All protection levels
Declaration Syntax
C#Visual BasicVisual C++
public static HttpCookie Encode(
	HttpCookie cookie
)
Public Shared Function Encode ( _
	cookie As HttpCookie _
) As HttpCookie
public:
static HttpCookie^ Encode(
	HttpCookie^ cookie
)
Parameters
cookie (HttpCookie)
An object of type HttpCookie to encode.
Return Value
An object of type HttpCookie encoded and tamper proof.
Examples
The following C# example demonstrates how to Encode a cookie.
CopyC#
//Create a value to store
string myValueToStoreInCookie = "My details";

//Create a "standard" (unencrypted) HttpCookie
HttpCookie myCookie = new HttpCookie("MyCookieName",myValueToStoreInCookie);

//encrypt the "standard" cookie
HttpCookie myEncodedCookie = Rolosoft.WebControls.CookieSecure.Encode(myCookie);

//Add the encoded cookie to the response stream.
Page.Response.AppendCookie(myEncodedCookie);
Exceptions
ExceptionCondition
CookieSecureExceptionThrown if cookie is invalid or tamper is detected.

Assembly: Rolosoft.CookieSecure.Net (Module: Rolosoft.CookieSecure.Net) Version: 1.0.3134.36402 (1.0.0.0)