Changeset 38 for trunk/WebServer/UHTTPSessionMySQL.pas
- Timestamp:
- Nov 13, 2010, 4:32:15 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/WebServer/UHTTPSessionMySQL.pas
r36 r38 40 40 Result := BinToHexString(SHA1(FloatToStr(Now))); 41 41 try 42 DbRows := SqlDatabase.Query('SELECT * FROM `HTTPSession` WHERE `Identification`="' + 42 DbRows := TDbRows.Create; 43 SqlDatabase.Query(DbRows, 'SELECT * FROM `HTTPSession` WHERE `Identification`="' + 43 44 Result + '"'); 44 45 Found := DbRows.Count > 0; … … 67 68 try 68 69 Lock.Acquire; 69 DbRows := SqlDatabase.Query('DELETE FROM `HTTPSession` WHERE `Time` < DATE_SUB(NOW(), INTERVAL ' + 70 DbRows := TDbRows.Create; 71 SqlDatabase.Query(DbRows, 'DELETE FROM `HTTPSession` WHERE `Time` < DATE_SUB(NOW(), INTERVAL ' + 70 72 IntToStr(Timeout) +' SECOND)'); 71 DbRows.Free; 72 DbRows := SqlDatabase.Query('SELECT * FROM `HTTPSession` WHERE `Identification`="' + 73 SqlDatabase.Query(DbRows, 'SELECT * FROM `HTTPSession` WHERE `Identification`="' + 73 74 HandlerData.SessionId + '"'); 74 75 if DbRows.Count > 0 then begin … … 91 92 try 92 93 Lock.Acquire; 93 DbRows := SqlDatabase.Query('SELECT * FROM `HTTPSession` WHERE `Identification`="' + 94 DbRows := TDbRows.Create; 95 DbRows2 := TDbRows.Create; 96 SqlDatabase.Query(DbRows, 'SELECT * FROM `HTTPSession` WHERE `Identification`="' + 94 97 HandlerData.SessionId + '"'); 95 98 if DbRows.Count > 0 then 96 DbRows2 := SqlDatabase.Query('UPDATE `HTTPSession` SET `Variables`="' + HandlerData.Session.Text99 SqlDatabase.Query(DbRows2, 'UPDATE `HTTPSession` SET `Variables`="' + HandlerData.Session.Text 97 100 + '", `Time` = NOW() WHERE `Identification`="' + HandlerData.SessionId + '"') 98 else DbRows2 := SqlDatabase.Query('INSERT INTO `HTTPSession` (`Time`, `Variables`, `Identification`) VALUES (' +101 else SqlDatabase.Query(DbRows2, 'INSERT INTO `HTTPSession` (`Time`, `Variables`, `Identification`) VALUES (' + 99 102 'NOW(), "' + HandlerData.Session.Text + '", "' + HandlerData.SessionId + '")'); 100 103 HandlerData.Response.Cookies.Values[SessionIdCookieName] := HandlerData.SessionId;
Note:
See TracChangeset
for help on using the changeset viewer.