Jump to content

Deprecated: Function session_is_registered() is deprecated in


Function

Recommended Posts

 

Can anyone help me fix this problem:  Deprecated: Function session_is_registered() is deprecated in/includes/functions/sessions.php on line 81

 

The code is: 

 

function tep_session_is_registered($variable) {

    return session_is_registered($variable);

  }

 

  function tep_session_unregister($variable) {

    return session_unregister($variable);

  }

 

Fairly new to PHP and would greatly appreciate any help!

Link to comment
Share on other sites

Thanks Wolfcry!

 

I changed all the session_register I could find to $_SESSION.

 

Now this error appeared:  Parse error: syntax error, unexpected T_VARIABLE, expecting '(' in /includes/functions/sessions.php on line 70

 

This is the code:

 

function tep_$_SESSION($variable) {

    global $session_started;

 

Appreciate any help!

Link to comment
Share on other sites

Thanks Wolfcry!

 

I did add } after on the next line after  global $session_started;  but it didn't fix it.

 

Here is the code from line 66 to 78

 

  function tep_session_start() {

    return session_start();

  }

 

  function tep_$_SESSION($variable) {

    global $session_started;

 

      if ($session_started == true) {

      return $_SESSION($variable);

    } else {

      return false;

    }

  }

 

Thanks for your help!

 

Link to comment
Share on other sites

I don't think this: tep_$_SESSION is a valid function name and the script is looking for the following () to indicate that it's a function on its own.  Try changing that to something else.

 

As far as I remember, reserved key words and functions cannot be used in the names of variables and other functions.

Link to comment
Share on other sites


function tep_session_is_registered($variable) {
    return isset($_SESSION[$variable]);
  }

  function tep_session_unregister($variable) {
    return unset($_SESSION[$variable]);
  }

 

I installed the code and got this error for something in the bottom line:    return unset($_SESSION[$variable]);

 

Parse error: syntax error, unexpected T_UNSET in /includes/functions/sessions.php on line 75

 

Appreciate your help!

 

Link to comment
Share on other sites

I've been trying to get the sessions.php script compatible to PHP 5.3

 

I now have this error:

 

Fatal error: Cannot redeclare tep_session_unregister() (previously declared in /includes/functions/sessions.php:74) in /home/ecgnatur/public_html/store_us/includes/functions/sessions.php on line 86

 

Would anyone know what needs to be changed?

Here is the code line 74 and 86 are in bold:

 

    session_set_save_handler('_sess_open', '_sess_close', '_sess_read', '_sess_write', '_sess_destroy', '_sess_gc');

  }

 

  function tep_session_start() {

    return session_start();

  }

 

  function tep_session_register($variable) {

    return isset($_SESSION[$variable]);

  }

 

  function tep_session_unregister($variable) {

    unset($_SESSION[$variable]);

 

    return;

  }

 

  function tep_session_is_registered($variable) {

    return ($_SESSION($variable));

  }

 

  function tep_session_unregister($variable) {

    return ($_SESSION($variable));

}

 

  function tep_session_id($sessid = '') {

    if (!empty($sessid)) {

      return session_id($sessid);

    } else {

      return session_id();

    }

  }

 

Appreciate any help

Link to comment
Share on other sites

look at your error. It is saying you already have a function called tep_session_unregister defined in another file. It tells you the other file and line.

 

Should i just take out the second one? The only difference is the first one has [ ] type brackets around variable and second one has ( ) type brackets around variable.

Does that matter?

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.