Update root deployment URLs and auth cookie path for non-/mvlog hosting
This commit is contained in:
parent
1f53c448e6
commit
304a146895
3 changed files with 7 additions and 3 deletions
4
auth.php
4
auth.php
|
|
@ -7,7 +7,7 @@ function mvlog_session_start(): void {
|
|||
session_name('MVLOGSESSID');
|
||||
session_set_cookie_params([
|
||||
'lifetime' => 0,
|
||||
'path' => '/mvlog',
|
||||
'path' => '/',
|
||||
'secure' => $secure,
|
||||
'httponly' => true,
|
||||
'samesite' => 'Strict',
|
||||
|
|
@ -39,7 +39,7 @@ function mvlog_current_user(): ?string {
|
|||
|
||||
function mvlog_require_login(): void {
|
||||
if (mvlog_current_user() !== null) return;
|
||||
$next = $_SERVER['REQUEST_URI'] ?? '/mvlog/new.php';
|
||||
$next = $_SERVER['REQUEST_URI'] ?? '/new.php';
|
||||
header('Location: login.php?next=' . rawurlencode($next));
|
||||
exit;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue