the $GLOBALS['core']->killAllSessions(); in the following code is not working. the code works good without it but i need it to work. is there another way to write it?
the error i get with $GLOBALS['core']->killAllSessions(); in the code is at the topic of this message.
if (!isset($GLOBALS['core'])){
header("location:../../");
exit();
}
$GLOBALS['core']->killAllSessions();
if (!$_SESSION['OBJ_user']->isUser()) {
$settings = $_SESSION["OBJ_user"]->getSettings();
if($settings["show_remember_me"])
$myCookie = PHPWS_User_Cookie::cookie_read("mod_users", "rememberme");
if(isset($myCookie)) {
$myCookie = preg_replace('/\W/', '', $myCookie);
$id = $GLOBALS["core"]->getOne("select user_id from mod_users where cookie='$myCookie'", TRUE);
if($id)
$_SESSION['OBJ_user']->loadUser($id, 1);
else
PHPWS_User::login_box();
} else {
PHPWS_User::login_box();
}
}
Call to a member function isUser() on a non-object on line 7
Moderator: General Moderators
-
stevestark5000
- Forum Commoner
- Posts: 61
- Joined: Thu Jan 27, 2011 12:08 am
-
cpetercarter
- Forum Contributor
- Posts: 474
- Joined: Sat Jul 25, 2009 2:00 am
Re: Call to a member function isUser() on a non-object on li
Could be that
destroys the session variables, so that the object $_SESSION['OBJ_user'] called in the next line no longer exists.
Code: Select all
$GLOBALS['core']->killAllSessions();-
stevestark5000
- Forum Commoner
- Posts: 61
- Joined: Thu Jan 27, 2011 12:08 am
Re: Call to a member function isUser() on a non-object on li
i figured it out. thank you