Class TBrookSession

Unit

Declaration

type TBrookSession = class(TBrookComponent)

Description

Defines features to the session handling.

Hierarchy

Overview

Methods

Protected function IsStarted: Boolean;
Protected procedure MakeSID(ARequest: TBrookRequest); virtual;
Protected procedure SetFileName; virtual;
Protected procedure SetCookie(AResponse: TBrookResponse); virtual;
Protected procedure Load; virtual;
Protected procedure Save; virtual;
Public constructor Create(AOwner: TComponent); override;
Public destructor Destroy; override;
Public procedure GetFields(AObject: TObject);
Public function IsExpired: Boolean; virtual;
Public function IsEmpty: Boolean; virtual;
Public function GenerateID: string; virtual;
Public procedure Start(ARequest: TBrookRequest); virtual;
Public procedure Finish(AResponse: TBrookResponse); virtual;
Public procedure Expire(ARequest: TBrookRequest; AResponse: TBrookResponse); virtual;
Public function Exists(const AName: string): Boolean;

Properties

Public property CookieName: string read FCookieName write FCookieName;
Public property CookieDomain: string read FCookieDomain write FCookieDomain;
Public property CookiePath: string read FCookiePath write FCookiePath;
Public property CookieSecure: Boolean read FCookieSecure write FCookieSecure;
Public property CookieExpires: TDateTime read FCookieExpires write FCookieExpires;
Public property Field[constAName:string]: string read GetField write SetField;
Public property Fields: TStrings read FFields write SetFields;
Public property IgnoredFields: TStrings read FIgnoredFields write SetIgnoredFields;
Public property Directory: string read FDirectory write FDirectory;
Public property Expired: Boolean read IsExpired;
Public property Empty: Boolean read IsEmpty;
Public property SID: string read FSID write FSID;
Public property Started: Boolean read IsStarted;
Public property FileName: TFileName read FFileName write FFileName;
Public property FilePrefix: ShortString read FFilePrefix write FFilePrefix;
Public property Timeout: Integer read FTimeout write FTimeout default BROOK_SESS_DEFAULT_TIMEOUT;
Public property HttpOnly: Boolean read FHttpOnly write FHttpOnly;
Public property AfterStart: TBrookSessionStartEvent read FAfterStart write FAfterStart;
Public property BeforeStart: TBrookSessionStartEvent read FBeforeStart write FBeforeStart;
Public property AfterFinish: TBrookSessionFinishEvent read FAfterFinish write FAfterFinish;
Public property BeforeFinish: TBrookSessionFinishEvent read FBeforeFinish write FBeforeFinish;
Public property AfterExpire: TBrookSessionExpireEvent read FAfterExpire write FAfterExpire;
Public property BeforeExpire: TBrookSessionExpireEvent read FBeforeExpire write FBeforeExpire;

Description

Methods

Protected function IsStarted: Boolean;
 
Protected procedure MakeSID(ARequest: TBrookRequest); virtual;
 
Protected procedure SetFileName; virtual;
 
Protected procedure SetCookie(AResponse: TBrookResponse); virtual;
 
Protected procedure Load; virtual;
 
Protected procedure Save; virtual;
 
Public constructor Create(AOwner: TComponent); override;

Creates an instance of a TBrookSession class.

Public destructor Destroy; override;

Frees an instance of TBrookSession class.

Public procedure GetFields(AObject: TObject);

Get an object with the fields coming from session.

Public function IsExpired: Boolean; virtual;

Returns True if the session has expired.

Public function IsEmpty: Boolean; virtual;

Returns True if the session fieds is empty.

Public function GenerateID: string; virtual;

Creates an ID for the session.

Public procedure Start(ARequest: TBrookRequest); virtual;

Starts the session.

Public procedure Finish(AResponse: TBrookResponse); virtual;

Terminates the session.

Public procedure Expire(ARequest: TBrookRequest; AResponse: TBrookResponse); virtual;

Expires the session.

Public function Exists(const AName: string): Boolean;

Checks if a name exists in fields.

Properties

Public property CookieName: string read FCookieName write FCookieName;

Set the session cookie name.

Public property CookieDomain: string read FCookieDomain write FCookieDomain;

Set the session cookie domain.

Public property CookiePath: string read FCookiePath write FCookiePath;

Set the session cookie path.

Public property CookieSecure: Boolean read FCookieSecure write FCookieSecure;

Set the session cookie secure.

Public property CookieExpires: TDateTime read FCookieExpires write FCookieExpires;

Set the session cookie expiration.

Public property Field[constAName:string]: string read GetField write SetField;

Handles the session fields.

Public property Fields: TStrings read FFields write SetFields;

The session fields.

Public property IgnoredFields: TStrings read FIgnoredFields write SetIgnoredFields;

The ignored fields by the session.

Public property Directory: string read FDirectory write FDirectory;

Set the name of session directory.

Public property Expired: Boolean read IsExpired;

Returns True if the session has expired.

Public property Empty: Boolean read IsEmpty;

Returns True if the session fieds is empty.

Public property SID: string read FSID write FSID;

Get or set the session ID.

Public property Started: Boolean read IsStarted;

Checks if the session has started.

Public property FileName: TFileName read FFileName write FFileName;

The session file name.

Public property FilePrefix: ShortString read FFilePrefix write FFilePrefix;

The session file prefix.

Public property Timeout: Integer read FTimeout write FTimeout default BROOK_SESS_DEFAULT_TIMEOUT;

The remaining seconds for the session finish.

Public property HttpOnly: Boolean read FHttpOnly write FHttpOnly;

Informs if the session cookie is accessible only by HTTP requests, if True, the JavaScript access is not allowed.

Public property AfterStart: TBrookSessionStartEvent read FAfterStart write FAfterStart;

Is triggered after session start.

Public property BeforeStart: TBrookSessionStartEvent read FBeforeStart write FBeforeStart;

Is triggered before session start.

Public property AfterFinish: TBrookSessionFinishEvent read FAfterFinish write FAfterFinish;

Is triggered after session finish.

Public property BeforeFinish: TBrookSessionFinishEvent read FBeforeFinish write FBeforeFinish;

Is triggered before session finish.

Public property AfterExpire: TBrookSessionExpireEvent read FAfterExpire write FAfterExpire;

Is triggered after session expire.

Public property BeforeExpire: TBrookSessionExpireEvent read FBeforeExpire write FBeforeExpire;

Is triggered before session expire.


Generated by PasDoc 0.15.0.