Jump to content

Correct way to rewrite this?


roldahayes

Recommended Posts

Hi,

 

I have upgraded my server from PHP 5.3.3 to version 5.5 and I'm now having a few problems with some code.

 

This line gives a fatal error of:

 

Call to undefined function session_is_registered()

 

 

if (session_is_registered("isAuthenticated") && ($_SESSION ['isAuthenticated'] = "loggedIn")) 

 

It appears this is depreciated?  How can I solve this?

 

 

Link to comment
https://forums.phpfreaks.com/topic/289276-correct-way-to-rewrite-this/
Share on other sites

Now that you know that function has been DEPRECATED (as in gone, not 'reduced in value'), the answer to your question is simply to use

if (isset($_SESSION['isAuthenticated']) && ($_SESSION ['isAuthenticated'] = "loggedIn")) 
NOTE - I left the error in your code in my sample. You have only one = sign in your compare - you need two.

No offense, but it might be a good idea to leave this task to somebody else.

 

Sessions are highly sensitive, because they're used for authentication and access control. If you don't know what you're doing and screw this up, you can get everybody into serious trouble.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.