Changeset 138 for trunk/Packages/CoolWeb/WebServer/UHTTPSessionMySQL.pas
- Timestamp:
- Sep 9, 2022, 8:20:25 PM (2 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Packages/CoolWeb/WebServer/UHTTPSessionMySQL.pas
r137 r138 64 64 65 65 procedure THTTPSessionStorageMySQL.GetSessionId(HandlerData: THTTPHandlerData); 66 var 67 Value: string; 66 68 begin 67 69 with HandlerData do begin 68 if Request.Cookies. SearchKey(SessionIdCookieName) <> -1then begin69 SessionId := Request.Cookies.Values[SessionIdCookieName];70 if Request.Cookies.TryGetValue(SessionIdCookieName, Value) then begin 71 SessionId := Value; 70 72 end else begin 71 73 SessionId := GetNewSessionId; … … 87 89 HandlerData.SessionId + '"'); 88 90 if DbRows.Count > 0 then begin 89 HandlerData.Session.Text := DbRows[0]. Values['Variables'];91 HandlerData.Session.Text := DbRows[0].Items['Variables']; 90 92 end else begin 91 93 HandlerData.SessionId := GetNewSessionId; … … 114 116 else Database.Query(DbRows2, 'INSERT INTO `HTTPSession` (`Time`, `Variables`, `Identification`) VALUES (' + 115 117 'NOW(), "' + HandlerData.Session.Text + '", "' + HandlerData.SessionId + '")'); 116 HandlerData.Response.Cookies. Values[SessionIdCookieName] := HandlerData.SessionId;118 HandlerData.Response.Cookies.Items[SessionIdCookieName] := HandlerData.SessionId; 117 119 finally 118 120 DbRows2.Free;
Note:
See TracChangeset
for help on using the changeset viewer.