Ignore:
Timestamp:
Apr 30, 2011, 10:54:24 PM (14 years ago)
Author:
george
Message:
  • Main web server classes reworked as components for easier visual design.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • Network/CoolWeb/WebServer/UHTTPSessionMySQL.pas

    r94 r237  
    1212  { TFileHTTPSessionStorage }
    1313
     14  { THTTPSessionStorageMySQL }
     15
    1416  THTTPSessionStorageMySQL = class(THTTPSessionStorage)
    1517  private
     18    FSessionIdCookieName: string;
     19    FTimeout: Integer;
    1620    Lock: TCriticalSection;
    1721    function GetNewSessionId: string;
    1822    procedure GetSessionId(HandlerData: THTTPHandlerData);
    1923  public
    20     Timeout: Integer; // in seconds
    2124    SqlDatabase: TSqlDatabase;
    22     SessionIdCookieName: string;
    2325    Sessions: TStringList;
    2426    procedure Load(HandlerData: THTTPHandlerData); override;
    2527    procedure Save(HandlerData: THTTPHandlerData); override;
    26     constructor Create; override;
     28    constructor Create(AOwner: TComponent); override;
    2729    destructor Destroy; override;
     30  published
     31    property Timeout: Integer read FTimeout write FTimeout; // in seconds
     32    property SessionIdCookieName: string read FSessionIdCookieName
     33      write FSessionIdCookieName;
    2834  end;
    2935
     36procedure Register;
     37
    3038implementation
     39
     40procedure Register;
     41begin
     42  RegisterComponents('CoolWeb', [THTTPSessionStorageMySQL]);
     43end;
     44
    3145
    3246{ THTTPSession }
     
    110124end;
    111125
    112 constructor THTTPSessionStorageMySQL.Create;
     126constructor THTTPSessionStorageMySQL.Create(AOwner: TComponent);
    113127begin
    114   inherited Create;
     128  inherited;
    115129  Lock := TCriticalSection.Create;
    116130  Sessions := TStringList.Create;
Note: See TracChangeset for help on using the changeset viewer.