File tree Expand file tree Collapse file tree 2 files changed +7
-2
lines changed
Expand file tree Collapse file tree 2 files changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -126,6 +126,11 @@ ENV PREFETCH_FILES=false
126126
127127ENV CORS_ALLOW_ANY_ORIGIN=true
128128
129+ # seconds. default 60 * 60 * 24 * 7 = 7 days
130+ ENV AUTH_COOKIE_LIFETIME=604800
131+
132+ ENV AUTH_COOKIE_HTTPONLY=true
133+
129134EXPOSE 8080
130135
131136CMD ["/init.sh" ]
Original file line number Diff line number Diff line change @@ -81,10 +81,10 @@ function set_auth_cookie(string $key): void
8181 if ( $ path === '') $ path = '/';
8282 // Cookie is httpOnly to avoid leaking via JS.
8383 setcookie('dir_browser_key', $ key, [
84- 'expires' => time() + 60 * 60 * 24 * 30 ,
84+ 'expires' => time() + $ {{` process.env.AUTH_COOKIE_LIFETIME `} }$ ,
8585 'path' => $ path,
8686 'secure' => $ secure,
87- 'httponly' => true ,
87+ 'httponly' => $ {{` process.env.AUTH_COOKIE_HTTPONLY `} }$ ,
8888 'samesite' => 'Lax',
8989 ]);
9090}
You can’t perform that action at this time.
0 commit comments