ExtremeSwank OpenID
ISessionPersistence Interface
NamespacesExtremeSwank.OpenIdISessionPersistence
Interface used by all objects implementing per-user session persistence.
Declaration Syntax
C#Visual BasicVisual C++
public interface ISessionPersistence
Public Interface ISessionPersistence
public interface class ISessionPersistence
Members
All MembersProperties



IconMemberDescription
Nonce
Gets or sets the nonce value used to protect against replay attacks.

Examples

Implementing the ISessionPersistence interface just requires implementing the Cnonce property. When the property is set, it must be persisted immediately.

The following code persists to the ASP.NET Session object.

CopyC#
public class SessionSessionManager : ISessionPersistence
{
    const string cnoncestr = "AllowLogin";

    #region ISessionPersistence Members

    public int Cnonce
    {
        get
        {
            if (HttpContext.Current.Session[cnoncestr] == null)
            {
                return -1;
            }
            return (int)HttpContext.Current.Session[cnoncestr];
        }
        set { HttpContext.Current.Session[cnoncestr] = value; }
    }

    #endregion
}

Assembly: ExtremeSwank.OpenId (Module: ExtremeSwank.OpenId) Version: 4.0.0.1 (4.0.0.1)