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;
|
ASessionID: string): string;
|
||||||
var
|
var
|
||||||
Cookie: TCookie;
|
Cookie: TCookie;
|
||||||
|
LSessTimeout: Integer;
|
||||||
begin
|
begin
|
||||||
Cookie := AContext.Response.Cookies.Add;
|
Cookie := AContext.Response.Cookies.Add;
|
||||||
Cookie.Name := TMVCConstants.SESSION_TOKEN_NAME;
|
Cookie.Name := TMVCConstants.SESSION_TOKEN_NAME;
|
||||||
Cookie.Value := ASessionID;
|
Cookie.Value := ASessionID;
|
||||||
// danieleteti - reintroduced sessiontimeout
|
LSessTimeout := StrToIntDef(AContext.Config[TMVCConfigKey.SessionTimeout], 0);
|
||||||
Cookie.Expires := now + OneMinute *
|
if LSessTimeout = 0 then
|
||||||
strtoint(AContext.Config[TMVCConfigKey.SessionTimeout]);
|
Cookie.Expires := 0
|
||||||
Cookie.Expires := 0; // session cookie;
|
else
|
||||||
|
Cookie.Expires := now + OneMinute * LSessTimeout;
|
||||||
Cookie.Path := '/';
|
Cookie.Path := '/';
|
||||||
Result := ASessionID;
|
Result := ASessionID;
|
||||||
end;
|
end;
|
||||||
|
Loading…
Reference in New Issue
Block a user