mirror of
git://f0xx.org/ac/ac-platform-php
synced 2026-07-29 03:58:16 +03:00
initial
This commit is contained in:
22
platform/shared_session.php
Normal file
22
platform/shared_session.php
Normal file
@@ -0,0 +1,22 @@
|
||||
<?php
|
||||
declare(strict_types=1);
|
||||
|
||||
/**
|
||||
* Shared session for all Android Cast web consoles (crashes, build, …).
|
||||
* Same cookie path + session name => one login across sub-apps.
|
||||
*/
|
||||
function platform_start_session(string $sessionName = 'ac_crash_sess', string $cookiePath = '/app/androidcast_project'): void
|
||||
{
|
||||
if (session_status() === PHP_SESSION_ACTIVE) {
|
||||
return;
|
||||
}
|
||||
session_name($sessionName);
|
||||
session_set_cookie_params([
|
||||
'lifetime' => 0,
|
||||
'path' => $cookiePath,
|
||||
'httponly' => true,
|
||||
'samesite' => 'Lax',
|
||||
'secure' => (!empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] !== 'off'),
|
||||
]);
|
||||
session_start();
|
||||
}
|
||||
Reference in New Issue
Block a user