Deprecated: Function session_is_registered()

Help with installation and general calendar setttings

Deprecated: Function session_is_registered()

Postby JohN » Fri May 17, 2013 3:23 pm

Hi Chris,

Using php5.3
When login out of the Admin, the next error is reported

Deprecated: Function session_is_registered() is deprecated in ../ac-admin/admin-logout.php on line 9

Changes are saved

Is this one as easy to solve as the other ?

Thanks
John
User avatar
JohN
 
Posts: 14
Joined: Fri Sep 30, 2011 1:42 am

Re: Deprecated: Function session_is_registered()

Postby JohN » Thu Jun 06, 2013 10:51 pm

Hi Chris,
You're not responding to my question.
Does this mean that you've stopped giving support on AjaxAvailability Calendar?

If so, I need to find an alternative :(

Thanks
JohN
User avatar
JohN
 
Posts: 14
Joined: Fri Sep 30, 2011 1:42 am

Re: Deprecated: Function session_is_registered()

Postby chris » Fri Jun 07, 2013 10:04 am

Hi John,
Sorry, somehow I missed your message.

Clearly the latested versions of PHP are causing conflicts with this script so I need to find time to update it with fixes for the PHP changes.

As regards your specific issue, you will need to replace the session logout code with the newer methods.

In the file ac-admin>admin-logout.php replace ALL the code with this (taken directly from php.com):
Code: Select all
<?php
// Initialize the session.
session_start();

// Unset all of the session variables.
$_SESSION = array();

// If it's desired to kill the session, also delete the session cookie.
// Note: This will destroy the session, and not just the session data!
if (ini_get("session.use_cookies")) {
    $params = session_get_cookie_params();
    setcookie(session_name(), '', time() - 42000,
        $params["path"], $params["domain"],
        $params["secure"], $params["httponly"]
    );
}

// Finally, destroy the session.
session_destroy();

//Chris - redirect to admin login
header("Location: index.php");
?>

That should resolve the issue and ensure that at least the logout page is forward compatable.

Chris
User avatar
chris
Site Admin
 
Posts: 1088
Joined: Mon Dec 17, 2007 7:42 pm
Location: Málaga, Spain

Re: Deprecated: Function session_is_registered()

Postby JohN » Sat Jun 08, 2013 5:11 pm

Hi Chris,

No problem at all, thanks for our response.

In the meantime I have been experimenting with the admin-logout.php file and
replaced the two functions with newer ones.
It seems that this works, no errors come up and after logging out you're logged out. ;-)

Complete code as:

Code: Select all
<?php
session_start();
function session_clear() {

    $exists = "no";
    $session_array = explode(";",session_encode());
    for ($x = 0; $x < count($session_array); $x++) {
        $name  = substr($session_array[$x], 0, strpos($session_array[$x],"|"));

         if (!isset($_SESSION[$name])) {

         unset($_SESSION['$name']);
            $exists = "yes";
        }
    }
    if ($exists != "no") {
        session_destroy();
   }
}
session_clear();

   if ( !isset( $_SESSION[session_name] ) ){
    header("Location: index.php");
}else{
   echo"<h1 style=\"color:red;\">NOT Logged Out</h1>";
   echo"Please contact the system administrator.";
}
?>
User avatar
JohN
 
Posts: 14
Joined: Fri Sep 30, 2011 1:42 am


Return to Support

Who is online

Users browsing this forum: No registered users and 5 guests

cron