File tree Expand file tree Collapse file tree 1 file changed +10
-1
lines changed Expand file tree Collapse file tree 1 file changed +10
-1
lines changed Original file line number Diff line number Diff line change @@ -188,15 +188,24 @@ protected static function lookup(string $key) {
188
188
Common::$ database = DatabaseDriver::getDatabaseObject ();
189
189
}
190
190
191
+ $ dt_now_str = (new DateTime (
192
+ 'now ' , new DateTimeZone ('Etc/UTC ' )
193
+ ))->format (self ::DATE_SQL );
194
+
191
195
$ fingerprint = false ;
192
196
193
197
try {
194
198
$ stmt = Common::$ database ->prepare ('
195
199
SELECT `user_id`, `ip_address`, `user_agent`
196
- FROM `user_sessions` WHERE `id` = :id LIMIT 1;
200
+ FROM `user_sessions`
201
+ WHERE `id` = :id AND (
202
+ `expires_datetime` = NULL OR
203
+ :dt < `expires_datetime`
204
+ ) LIMIT 1;
197
205
' );
198
206
199
207
$ stmt ->bindParam (':id ' , $ key , PDO ::PARAM_STR );
208
+ $ stmt ->bindParam (':dt ' , $ dt_now_str , PDO ::PARAM_STR );
200
209
201
210
$ r = $ stmt ->execute ();
202
211
You can’t perform that action at this time.
0 commit comments