fix cookies
This commit is contained in:
parent
9c5231c298
commit
928267287d
3 changed files with 10 additions and 5 deletions
1
.gitignore
vendored
1
.gitignore
vendored
|
@ -1,2 +1 @@
|
||||||
data
|
data
|
||||||
conf/ldap/ldap.env
|
|
||||||
|
|
|
@ -7,3 +7,4 @@ LDAP_FILTER="(&)"
|
||||||
LDAP_UID="cn"
|
LDAP_UID="cn"
|
||||||
|
|
||||||
HTTP_HOST=auth.example.com
|
HTTP_HOST=auth.example.com
|
||||||
|
COOKIE_DOMAIN=example.com
|
||||||
|
|
|
@ -13,13 +13,18 @@ function get_cookie() {
|
||||||
|
|
||||||
function store_cookie($key) {
|
function store_cookie($key) {
|
||||||
$cookie_name = 'X-LDAP-Auth-Key';
|
$cookie_name = 'X-LDAP-Auth-Key';
|
||||||
|
$cookie_options = array (
|
||||||
|
'expires' => time() + 60*60*24*30,
|
||||||
|
'path' => '/',
|
||||||
|
'domain' => getenv("COOKIE_DOMAIN"),
|
||||||
|
'secure' => true,
|
||||||
|
'httponly' => true,
|
||||||
|
'samesite' => 'None'
|
||||||
|
);
|
||||||
setcookie(
|
setcookie(
|
||||||
$cookie_name,
|
$cookie_name,
|
||||||
$key,
|
$key,
|
||||||
time() + (86400 * 30),
|
$cookie_options
|
||||||
"/",
|
|
||||||
TRUE,
|
|
||||||
TRUE
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue