check session name COOKIE before ensuring session
darcs-hash:20080624034906-34904-a21bab1db498d69c616606126f6b788a2188b1e2.gz
This commit is contained in:
parent
25a6f240a4
commit
1db5ba0576
16
lib/util.php
16
lib/util.php
|
@ -506,15 +506,15 @@ function common_forgetme() {
|
||||||
|
|
||||||
# who is the current user?
|
# who is the current user?
|
||||||
function common_current_user() {
|
function common_current_user() {
|
||||||
|
if ($_REQUEST[session_name()]) {
|
||||||
common_ensure_session();
|
common_ensure_session();
|
||||||
$id = $_SESSION['userid'];
|
$id = $_SESSION['userid'];
|
||||||
if ($id) {
|
if ($id) {
|
||||||
# note: this should cache
|
# note: this should cache
|
||||||
$user = User::staticGet($id);
|
$user = User::staticGet($id);
|
||||||
return $user;
|
return $user;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
# that didn't work; try to remember
|
# that didn't work; try to remember
|
||||||
$user = common_remembered_user();
|
$user = common_remembered_user();
|
||||||
return $user;
|
return $user;
|
||||||
|
|
Loading…
Reference in New Issue
Block a user