Ignore:
Timestamp:
Sep 9, 2022, 8:20:25 PM (2 years ago)
Author:
chronos
Message:
  • Modified: Removed TemplateGenerics package. Generics usage replaced by standard Generics.Collections.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Packages/CoolWeb/WebServer/UHTTPSessionMySQL.pas

    r137 r138  
    6464
    6565procedure THTTPSessionStorageMySQL.GetSessionId(HandlerData: THTTPHandlerData);
     66var
     67  Value: string;
    6668begin
    6769  with HandlerData do begin
    68     if Request.Cookies.SearchKey(SessionIdCookieName) <> -1 then begin
    69       SessionId := Request.Cookies.Values[SessionIdCookieName];
     70    if Request.Cookies.TryGetValue(SessionIdCookieName, Value) then begin
     71      SessionId := Value;
    7072    end else begin
    7173      SessionId := GetNewSessionId;
     
    8789      HandlerData.SessionId + '"');
    8890    if DbRows.Count > 0 then begin
    89       HandlerData.Session.Text := DbRows[0].Values['Variables'];
     91      HandlerData.Session.Text := DbRows[0].Items['Variables'];
    9092    end else begin
    9193      HandlerData.SessionId := GetNewSessionId;
     
    114116    else Database.Query(DbRows2, 'INSERT INTO `HTTPSession` (`Time`,  `Variables`, `Identification`) VALUES (' +
    115117    'NOW(), "' + HandlerData.Session.Text + '", "' + HandlerData.SessionId + '")');
    116     HandlerData.Response.Cookies.Values[SessionIdCookieName] := HandlerData.SessionId;
     118    HandlerData.Response.Cookies.Items[SessionIdCookieName] := HandlerData.SessionId;
    117119  finally
    118120    DbRows2.Free;
Note: See TracChangeset for help on using the changeset viewer.