mirror of
https://github.com/danieleteti/delphimvcframework.git
synced 2024-11-15 15:55:54 +01:00
FIX about session cookie
This commit is contained in:
parent
51feaf2f33
commit
80be08f7fc
@ -1089,14 +1089,16 @@ class function TMVCEngine.SendSessionCookie(AContext: TWebContext;
|
||||
ASessionID: string): string;
|
||||
var
|
||||
Cookie: TCookie;
|
||||
LSessTimeout: Integer;
|
||||
begin
|
||||
Cookie := AContext.Response.Cookies.Add;
|
||||
Cookie.Name := TMVCConstants.SESSION_TOKEN_NAME;
|
||||
Cookie.Value := ASessionID;
|
||||
// danieleteti - reintroduced sessiontimeout
|
||||
Cookie.Expires := now + OneMinute *
|
||||
strtoint(AContext.Config[TMVCConfigKey.SessionTimeout]);
|
||||
Cookie.Expires := 0; // session cookie;
|
||||
LSessTimeout := StrToIntDef(AContext.Config[TMVCConfigKey.SessionTimeout], 0);
|
||||
if LSessTimeout = 0 then
|
||||
Cookie.Expires := 0
|
||||
else
|
||||
Cookie.Expires := now + OneMinute * LSessTimeout;
|
||||
Cookie.Path := '/';
|
||||
Result := ASessionID;
|
||||
end;
|
||||
|
Loading…
Reference in New Issue
Block a user