Class StaticCookieManager

A generic Web Cookie handler class that can be used for a single 'UserId' in an application. This class manages all aspects of retrieving and setting of a cookie consistently. Typically all you'll need to do is call the GetId() method which both returns existing cookies and ensures that the cookie gets set.

All methods of this class are static which is the reason why only a single Cookie can be managed at a time. The idea is that you can use this single cookie as an application global Cookie to track a user and then retrieve additional storage information from other locations (like a database or session).

System.Object
  Westwind.Web.StaticCookieManager
public class StaticCookieManager : object

Class Members

MemberDescription

Constructor

CookieName

CookieTimeoutInMonths

CookieExist

Determines whether the cookie exists

public static bool CookieExist()

GetId

public static string GetId()

Remove

Removes the cookie by clearing it out and expiring it immediately.

public static void Remove()

WriteCookie

Writes the cookie into the response stream with the value passed. The value is always the UserId.

public static void WriteCookie(string Value,     bool NonPersistent)

public static void WriteCookie(string Value)

Requirements

Namespace: Westwind.Web
Assembly: westwind.web.dll

© West Wind Technologies, 1996-2016 • Updated: 12/12/15
Comment or report problem with topic