Rolosoft Documented Class Library
Decode Method (cookie, cookieProtection)
NamespacesRolosoft.WebControlsCookieSecureDecode(HttpCookie, CookieProtection)
Decodes a cookie from definable protection level.
Declaration Syntax
C#Visual BasicVisual C++
public static HttpCookie Decode(
	HttpCookie cookie,
	CookieProtection cookieProtection
)
Public Shared Function Decode ( _
	cookie As HttpCookie, _
	cookieProtection As CookieProtection _
) As HttpCookie
public:
static HttpCookie^ Decode(
	HttpCookie^ cookie, 
	CookieProtection cookieProtection
)
Parameters
cookie (HttpCookie)
The encoded cookie to decode of type HttpCookie.
cookieProtection (CookieProtection)
An enumeration of type CookieProtection defining the level of protection to use when decoding the cookie.
Return Value
An object of type HttpCookie which is the decoded cookie.
Examples
The following C# example shows how to decode a cookie that has been encoded using "Encryption" only.
CopyC#
HttpCookie standardCookie = Request.Cookies["MyCookieName"];
if(standardCookie!=null)
    {
    HttpCookie decodedCookie = Rolosoft.WebControls.CookieSecure.Decode(standardCookie,System.Web.Security.CookieProtection.Encryption);
    //...Go on to process decoded cookie
    }
Exceptions
ExceptionCondition
CookieSecureExceptionThrown if cookie is invalid or tampered.

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