Skip to content
Snippets Groups Projects
Commit b1d86208 authored by Dries Buytaert's avatar Dries Buytaert
Browse files

- Applied Marco's first "remember me" patch.
parent 3b5c3806
No related branches found
No related tags found
2 merge requests!7452Issue #1797438. HTML5 validation is preventing form submit and not fully...,!789Issue #3210310: Adjust Database API to remove deprecated Drupal 9 code in Drupal 10
......@@ -636,6 +636,18 @@ function user_login($edit = array()) {
user_save($user, array("sid" => session_id()));
/*
** If the user wants to be remembered, set the proper cookie such
** that the session won't expire.
*/
if ($edit["remember_me"]) {
setcookie(session_name(), session_id(), time() + 3600 * 24 * 365);
}
else {
setcookie(session_name(), session_id());
}
/*
** Redirect the user to the page he logged on from or to his personal
** information page if we can detect the referer page:
......
......@@ -636,6 +636,18 @@ function user_login($edit = array()) {
user_save($user, array("sid" => session_id()));
/*
** If the user wants to be remembered, set the proper cookie such
** that the session won't expire.
*/
if ($edit["remember_me"]) {
setcookie(session_name(), session_id(), time() + 3600 * 24 * 365);
}
else {
setcookie(session_name(), session_id());
}
/*
** Redirect the user to the page he logged on from or to his personal
** information page if we can detect the referer page:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment