aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorredmatrix <git@macgirvin.com>2016-04-03 17:38:17 -0700
committerredmatrix <git@macgirvin.com>2016-04-03 17:38:17 -0700
commita703835b5cdbe737be98374a51363426083fee8f (patch)
tree9c561d2add476833c6ea4147ecf69518cad9003e
parentbf3f3564e08754c3f91524798523839ae7b9094c (diff)
downloadvolse-hubzilla-a703835b5cdbe737be98374a51363426083fee8f.tar.gz
volse-hubzilla-a703835b5cdbe737be98374a51363426083fee8f.tar.bz2
volse-hubzilla-a703835b5cdbe737be98374a51363426083fee8f.zip
Bug: "remember me" doesn't
-rwxr-xr-xboot.php2
-rw-r--r--include/auth.php4
-rw-r--r--include/session.php3
-rwxr-xr-xindex.php5
-rwxr-xr-xview/tpl/login.tpl2
5 files changed, 11 insertions, 5 deletions
diff --git a/boot.php b/boot.php
index c4d8ec13a..a357d7ecb 100755
--- a/boot.php
+++ b/boot.php
@@ -1580,7 +1580,7 @@ function login($register = false, $form_id = 'main-login', $hiddens=false) {
'$form_id' => $form_id,
'$lname' => array('username', t('Email') , '', ''),
'$lpassword' => array('password', t('Password'), '', ''),
- '$remember' => array('remember', t('Remember me'), '', '',array(t('No'),t('Yes'))),
+ '$remember_me' => array('remember_me', t('Remember me'), '', '',array(t('No'),t('Yes'))),
'$hiddens' => $hiddens,
'$register' => $reg,
'$lostpass' => t('Forgot your password?'),
diff --git a/include/auth.php b/include/auth.php
index aaec45c40..228143e12 100644
--- a/include/auth.php
+++ b/include/auth.php
@@ -246,7 +246,7 @@ else {
notice( t('Failed authentication') . EOL);
}
- logger('authenticate: ' . print_r(App::$account, true), LOGGER_DEBUG);
+ logger('authenticate: ' . print_r(App::$account, true), LOGGER_ALL);
}
if((! $record) || (! count($record))) {
@@ -274,7 +274,7 @@ else {
// (i.e. expire when the browser is closed), even when there's a time expiration
// on the cookie
- if($_POST['remember']) {
+ if($_POST['remember_me']) {
new_cookie(31449600); // one year
}
else {
diff --git a/include/session.php b/include/session.php
index 71bfdc12a..82f82a9b9 100644
--- a/include/session.php
+++ b/include/session.php
@@ -45,12 +45,13 @@ function nuke_session() {
function new_cookie($time) {
+
$old_sid = session_id();
// ??? This shouldn't have any effect if called after session_start()
// We probably need to set the session expiration and change the PHPSESSID cookie.
+ // session_set_cookie_params($time);
- session_set_cookie_params($time);
session_regenerate_id(false);
q("UPDATE session SET sid = '%s' WHERE sid = '%s'",
diff --git a/index.php b/index.php
index a6ed3dbc6..a9a55dca7 100755
--- a/index.php
+++ b/index.php
@@ -84,6 +84,11 @@ if(! App::$install) {
*
*/
+/* session_set_cookie_params() needs to happen before session_start() */
+
+if($_POST['remember_me'])
+ session_set_cookie_params(31556926);
+
session_start();
/**
diff --git a/view/tpl/login.tpl b/view/tpl/login.tpl
index da38f3571..d56c8f272 100755
--- a/view/tpl/login.tpl
+++ b/view/tpl/login.tpl
@@ -5,7 +5,7 @@
<div id="login-input" class="form-group">
{{include file="field_input.tpl" field=$lname}}
{{include file="field_password.tpl" field=$lpassword}}
- {{include file="field_checkbox.tpl" field=$remember}}
+ {{include file="field_checkbox.tpl" field=$remember_me}}
<button type="submit" name="submit" class="btn btn-block btn-primary">{{$login}}</button>
</div>
<div id="login-extra-links">