PHP 5.4 removed functions and admin-logout.php

Help with installation and general calendar setttings

PHP 5.4 removed functions and admin-logout.php

Postby alastair » Mon Nov 11, 2013 3:57 pm

Hi Chris,

My host is forcing me to upgrade from php 5.3 to 5.4.

I've been testing my site (which uses 3.3.7) on the newer version - everything in the calendar works as expected (sadly not the rest of the site...) except the admin-logout.php script. It looks as if the issue is with a couple of php functions the script uses being removed in the new version: session_is_registered(), and session_unregister(). The page loads to a white screen and the user is not logged out.

I was just wondering if you have any plans to update the script or, if not, any suggestions about how to adapt the script to work under php 5.4?

Many thanks,

Alastair
alastair
 
Posts: 5
Joined: Wed Sep 01, 2010 12:29 pm

Re: PHP 5.4 removed functions and admin-logout.php

Postby chris » Tue Nov 12, 2013 5:45 pm

Hi Alastair.
I'm afraid that at the moment I am unable to release a new version of the script.

However, to resolve this issue please replace the entire contents of the ac-admin > admin-logout.php file with the following code:

Code: Select all
<?php
// Initialize the session.
session_start();

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

// delete session cookie to completely clear all session related 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"]
    );
}

// Destroy the session.
session_destroy();

// redirect to admin home page
header("Location: index.php");
?>


Let me know if you have any problems.

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

Re: PHP 5.4 removed functions and admin-logout.php

Postby alastair » Wed Nov 13, 2013 12:27 pm

That worked a treat. Thank you very much for your help.

Alastair
alastair
 
Posts: 5
Joined: Wed Sep 01, 2010 12:29 pm


Return to Support

Who is online

Users browsing this forum: No registered users and 3 guests

cron