Jump to content

Archived

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

chaiwei

[SOLVED] SESSION_REGISTER()

Recommended Posts

Hi all,

 

Is it the SESSION_REGISTER is being deprecated already?

Actually what means by deprecated?

Is it it should not be use already?(but still function yet.)

 

If I am not using session_register what else can i set a session?

Please advise.

thanks

Share this post


Link to post
Share on other sites

deprecated means It's still possible to use it but that you can run into problems since it wont get updated anymore.

 

use that instead ^^

session_start();
$_SESSION["variable_something"] = 'Yay! i'm into a session var!!';

 

edit : thanks DarkWater for session_start() I forgot :P

Share this post


Link to post
Share on other sites

session_register() is indeed deprecated.  That means that it is highly discouraged to use it at all, and it could be potentially removed.  You should just use the $_SESSION superglobal for all your session needs. :D

 

<?php
session_start();
$_SESSION['name'] = "DarkWater";
?>

Share this post


Link to post
Share on other sites

session_register(), session_is_registered() and session_unregister() are dependent on register_globals. Register_globals were turned off starting in php4.2 in the year 2002. No new code should have been written after that point in time that used these functions. These functions have been removed in php6. Any code using them will stop working under php6 and must be changed to use the $_SESSION array variables.

Share this post


Link to post
Share on other sites

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