mirror of
https://gitlab.archlinux.org/archlinux/aurweb.git
synced 2025-02-03 10:43:03 +01:00
Make persistent cookie timeout configurable via "config.inc" (FS#22994).
Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
This commit is contained in:
parent
31b0b68b47
commit
52dfa9ca7c
2 changed files with 5 additions and 1 deletions
|
@ -601,6 +601,8 @@ function display_account_info($U="", $T="", $E="", $R="", $I="") {
|
||||||
* SID of 0 means login failed.
|
* SID of 0 means login failed.
|
||||||
*/
|
*/
|
||||||
function try_login() {
|
function try_login() {
|
||||||
|
global $PERSISTENT_COOKIE_TIMEOUT;
|
||||||
|
|
||||||
$login_error = "";
|
$login_error = "";
|
||||||
$new_sid = "";
|
$new_sid = "";
|
||||||
$userID = null;
|
$userID = null;
|
||||||
|
@ -641,7 +643,7 @@ function try_login() {
|
||||||
|
|
||||||
if ($_POST['remember_me'] == "on") {
|
if ($_POST['remember_me'] == "on") {
|
||||||
# Set cookies for 30 days.
|
# Set cookies for 30 days.
|
||||||
$cookie_time = time() + (60 * 60 * 24 * 30);
|
$cookie_time = time() + $PERSISTENT_COOKIE_TIMEOUT;
|
||||||
|
|
||||||
# Set session for 30 days.
|
# Set session for 30 days.
|
||||||
$q = "UPDATE Sessions SET LastUpdateTS = $cookie_time ";
|
$q = "UPDATE Sessions SET LastUpdateTS = $cookie_time ";
|
||||||
|
|
|
@ -48,3 +48,5 @@ $SUPPORTED_LANGS = array(
|
||||||
# Idle seconds before timeout
|
# Idle seconds before timeout
|
||||||
$LOGIN_TIMEOUT = 7200;
|
$LOGIN_TIMEOUT = 7200;
|
||||||
|
|
||||||
|
# Session timeout when using "Remember me" cookies
|
||||||
|
$PERSISTENT_COOKIE_TIMEOUT = 60 * 60 * 24 * 30;
|
||||||
|
|
Loading…
Add table
Reference in a new issue