Jump to content

Correct way to rewrite this?


roldahayes
Go to solution Solved by ginerjm,

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
Share on other sites

  • Solution

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.
Link to comment
Share on other sites

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.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.