Skip to content

Commit

Permalink
WIP session refactor
Browse files Browse the repository at this point in the history
authcookie use path

and put the directory separator before in path
  • Loading branch information
vincent-peugnet committed Dec 24, 2023
1 parent 50922a2 commit 1664d3b
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion app/class/Modelconnect.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ public function createauthcookie(string $userid, string $wsession, int $conserva
throw new RuntimeException("Secret Key not set");
}
$jwt = JWT::encode($datas, Config::secretkey());
$cookie = setcookie('authtoken', $jwt, time() + $conservation * 24 * 3600, "", "", false, true);
$cookie = setcookie('authtoken', $jwt, time() + $conservation * 24 * 3600, '/' . Config::basepath(), "", false, true);

Check warning on line 27 in app/class/Modelconnect.php

View workflow job for this annotation

GitHub Actions / lint php

Line exceeds 120 characters; contains 126 characters
if (!$cookie) {
throw new RuntimeException("Cant be send");
}
Expand Down
2 changes: 1 addition & 1 deletion index.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
$app = new Wcms\Application();
$app->wakeup();

session_set_cookie_params(['path' => Wcms\Config::basepath() . '/']);
session_set_cookie_params(['path' => '/' . Wcms\Config::basepath()]);
session_start();

if (class_exists('Whoops\Run') && !empty(Wcms\Config::debug())) {
Expand Down

0 comments on commit 1664d3b

Please sign in to comment.