summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDave Barry <dave@psax.org>2008-07-14 01:00:37 -0400
committerDave Barry <dave@psax.org>2008-07-14 01:00:37 -0400
commit8b1bf1e38cd39db084f5c14ed2b625c22897de70 (patch)
tree5f6319f021f52989fe11cd2024a80cfabc58bda4
parent6d83130f322688742694adb6e3232b3353c80987 (diff)
Fixup rememberme cookie handling in the POST only case
darcs-hash:20080714050037-08d49-b00c6370c4eed918eee94f828e2d6098b922ba69.gz
-rw-r--r--lib/util.php7
1 files changed, 6 insertions, 1 deletions
diff --git a/lib/util.php b/lib/util.php
index 33a2cac28..1b672561f 100644
--- a/lib/util.php
+++ b/lib/util.php
@@ -548,7 +548,7 @@ function common_forgetme() {
# who is the current user?
function common_current_user() {
- if ($_REQUEST[session_name()]) {
+ if ($_REQUEST[session_name()] || $_SESSION && $_SESSION['userid']) {
common_ensure_session();
$id = $_SESSION['userid'];
if ($id) {
@@ -559,6 +559,11 @@ function common_current_user() {
}
# that didn't work; try to remember
$user = common_remembered_user();
+ common_debug("Got User " . $user->nickname);
+ if ($user) {
+ common_debug("Faking session on remembered user");
+ $_SESSION['userid'] = $user->id;
+ }
return $user;
}