PHP Fatal error: function call undefined session_register ()

I moved my site from php 5.3 to 5.4, and now I can’t login to the admin site

I see this error:

PHP Fatal error: call to undefined session_register () function in / home / regimhot / public _html / webmotionsV4 / mvc / models / kit_model_useri.php on line 18

The code with the problem:

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 session_register function is not supported by php 5.4

+6
source share
2 answers

This function has been DEPRECATED since PHP 5.3.0 and removed from PHP 5.4.0.

http://www.php.net/manual/en/function.session-register.php

Make sure you have session_start() since simply deleting session_register() and using the destination $_SESSION will not work.

+16
source

In the documentation, the session_register() function is deprecated in version 5.3.0 and completely removed from PHP in 5.4.0. I suspect you are using version 5.4.0.

http://www.php.net/manual/en/function.session-register.php

+5
source

All Articles