[PHP] Using $_SESSION vs. session_register
I have a large-ish backend that I made with the (now deprecated) session_register, session_is_registered, session_unset, session_destroy functions.
Now I've made a frontend for that backend using the superglobal $_SESSION instead, setting session variables like so:
PHP Code:
$_SESSION["UID"] = $row['userid'];
$_SESSION["LAST_TS"] = $row['last_login'];
after these are set, the login script redirects to the site frontpage (using the header function), where I check these variables to decide what parts to display. However I can't access them / they are empty! I know that they do get set though, because I can access the backend without logging in there as well (same credentials), and I can also logout successfully (using unset()). So I'm wondering why are they not available to me on the frontpage?
I did read in the PHP manual that you are not supposed to use the old session functions with the new $_SESSION superglobal, but I don't in the frontend scripts. I do in use these functions in the backend but they are not really connected.. they include the same headers.php file, and functions pages, but these don't use session variables, just session_start() and ob_start().
If I've made myself understood, are there any suggestions?