I have moved my site from php 5.3 to 5.4 and now I cannot login to site admin
I see this error:
PHP Fatal error: Call to undefined function session_register() in /home/regimhot/public_html/webmotionsV4/mvc/models/kit_model_useri.php on line 18
The code with the problem is:
function login($username, $password) {
if(!$username || !$password) return false;
if($this->useri[$username]['password']==$password) {
session_register('userInfo');
$_SESSION['userInfo'] = $this->useri[$username];
$_SESSION['userInfo']['logat'] = true;
$this->userInfo = &$_SESSION['userInfo'];
How can I solve the problem? i know that the function session_register is not suported by php 5.4
This function has been DEPRECATED as of PHP 5.3.0 and REMOVED as of PHP 5.4.0.
http://www.php.net/manual/en/function.session-register.php
Make sure you have session_start()
, as just removing session_register()
and relying on the $_SESSION
assignment won't work.
Per the documentation, the session_register()
function was deprecated in version 5.3.0 and removed from PHP entirely in 5.4.0. I suspect that you're using version 5.4.0.
http://www.php.net/manual/en/function.session-register.php
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With