mirror of
https://gitlab.archlinux.org/archlinux/aurweb.git
synced 2025-02-03 10:43:03 +01:00
Remember user between sessions.
Signed-off-by: Loui Chang <louipc.ist@gmail.com>
This commit is contained in:
parent
36ee556103
commit
2feee92a75
4 changed files with 11 additions and 1 deletions
|
@ -644,7 +644,12 @@ function try_login() {
|
|||
if ($logged_in) {
|
||||
# set our SID cookie
|
||||
|
||||
setcookie("AURSID", $new_sid, 0, "/");
|
||||
if ($_POST['remember_me'] == "on")
|
||||
# Set cookies for 30 days.
|
||||
$cookie_time = time() + (60 * 60 * 24 * 30);
|
||||
else
|
||||
$cookie_time = 0;
|
||||
setcookie("AURSID", $new_sid, $cookie_time, "/");
|
||||
# header("Location: /index.php");
|
||||
header("Location: " . $_SERVER['PHP_SELF'].'?'.$_SERVER['QUERY_STRING']);
|
||||
$login_error = "";
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue