delphimvcframework/samples/sessioncustom/WebModuleUnit1.pas
Daniele Teti 81744b892e Merge changes from https://github.com/danieleteti/delphimvcframework/pull/60
Some refactoring needed to be coherent to the rest of the framework
Added a new sample to chow customsession utilization
2016-12-05 15:51:05 +01:00

44 lines
777 B
ObjectPascal

unit WebModuleUnit1;
interface
uses System.SysUtils,
System.Classes,
Web.HTTPApp,
MVCFramework;
type
TWebModule1 = class(TWebModule)
procedure WebModuleCreate(Sender: TObject);
private
MVC: TMVCEngine;
public
{ Public declarations }
end;
var
WebModuleClass: TComponentClass = TWebModule1;
implementation
{$R *.dfm}
uses AppControllerU;
procedure TWebModule1.WebModuleCreate(Sender: TObject);
begin
MVC := TMVCEngine.Create(Self);
MVC.Config[TMVCConfigKey.SessionTimeout] := '10'; // 10minutes
MVC.Config[TMVCConfigKey.DefaultContentType] := 'text/plain';
// comment the line to use default session type (memory)
MVC.Config[TMVCConfigKey.SessionType] := 'memoryController';
MVC.AddController(TApp1MainController);
end;
end.