Class UserState

User information container that can easily 'serialize' to a string and back. Meant to hold basic logon information to avoid trips to the database for common information required by an app to validate and display user info.

I use this class a lot to attach as Forms Authentication Ticket data to keep basic user data without having to hit the database

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

Class Members

MemberDescription

Constructor

CreateFromFormsAuthTicket

Creates a UserState object from authentication information in the Forms Authentication ticket.

public static UserState CreateFromFormsAuthTicket()

CreateFromFormsAuthTicket<T>

Creates a UserState object from authentication information in the Forms Authentication ticket.

public static T CreateFromFormsAuthTicket()

CreateFromString

Creates an instance of a userstate object from serialized data.

public static UserState CreateFromString(string userData)

CreateFromString<T>

Creates an instance of a userstate object from serialized data.

public static T CreateFromString(string userData)

FromString

Imports Id, Email and Name from a | separated string

public bool FromString(string itemString)

IsEmpty

Determines whether UserState instance holds user information.

public bool IsEmpty()

ToString

Exports a short string list of Id, Email, Name separated by |

public virtual string ToString()

Email

The user's email address or login acount

IsAdmin

The users admin status

Name

The display name for the userId

SecurityToken

A unique id created for this entry that can be used to identify the user outside of the UserState context

UserId

The user's user Id as a string

UserIdInt

Returns the User Id as an int if convertiable

Requirements

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

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