Skip to content
Snippets Groups Projects
Verified Commit ee626228 authored by Damien's avatar Damien
Browse files

FEAT Add id in cookie

parent 7c8d9137
No related branches found
No related tags found
No related merge requests found
...@@ -85,7 +85,7 @@ class AuthenticationModel ...@@ -85,7 +85,7 @@ class AuthenticationModel
} }
$user = DatabaseModel::select([ $user = DatabaseModel::select([
'select' => ['cookie_key'], 'select' => ['id', 'cookie_key'],
'table' => ['users'], 'table' => ['users'],
'where' => ['user_id = ?', 'cookie_date > CURRENT_TIMESTAMP'], 'where' => ['user_id = ?', 'cookie_date > CURRENT_TIMESTAMP'],
'data' => [$args['userId']] 'data' => [$args['userId']]
...@@ -109,7 +109,7 @@ class AuthenticationModel ...@@ -109,7 +109,7 @@ class AuthenticationModel
'data' => [$args['userId']] 'data' => [$args['userId']]
]); ]);
$cookieData = json_encode(['userId' => $args['userId'], 'cookieKey' => $cookieKey]); $cookieData = json_encode(['id' => $user[0]['id'],'userId' => $args['userId'], 'cookieKey' => $cookieKey]);
setcookie('maarchCourrierAuth', base64_encode($cookieData), $cookieTime, $cookiePath, '', false, false); setcookie('maarchCourrierAuth', base64_encode($cookieData), $cookieTime, $cookiePath, '', false, false);
return true; return true;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment