fix: loading existing session
This commit is contained in:
parent
fcd6378fef
commit
229d04eb07
1 changed files with 4 additions and 6 deletions
|
@ -644,7 +644,7 @@ class User
|
||||||
|
|
||||||
public function loadFromSession(): void
|
public function loadFromSession(): void
|
||||||
{
|
{
|
||||||
if (!$this->isLoggedIn()) {
|
if (!isset($_COOKIE['wishthis_session'])) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -660,11 +660,9 @@ class User
|
||||||
->query(
|
->query(
|
||||||
'SELECT *
|
'SELECT *
|
||||||
FROM `sessions`
|
FROM `sessions`
|
||||||
WHERE `session` = :session
|
WHERE `session` = :session',
|
||||||
AND `user` = :user',
|
|
||||||
array(
|
array(
|
||||||
'session' => $_COOKIE['wishthis'],
|
'session' => $_COOKIE['wishthis_session'],
|
||||||
'user' => $this->id,
|
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
->fetch(\PDO::FETCH_ASSOC);
|
->fetch(\PDO::FETCH_ASSOC);
|
||||||
|
@ -679,7 +677,7 @@ class User
|
||||||
FROM `users`
|
FROM `users`
|
||||||
WHERE `id` = :user',
|
WHERE `id` = :user',
|
||||||
array(
|
array(
|
||||||
'user' => $this->id,
|
'user' => $session['user'],
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
->fetch(\PDO::FETCH_ASSOC);
|
->fetch(\PDO::FETCH_ASSOC);
|
||||||
|
|
Loading…
Reference in a new issue