does anyone knows the alternative to the deprecated function session_is_registered in PHP5?

here's my code:

ob_start();

session_start();

if(!session_is_registered(myusername))

{

    header("location:main_login.php");

}

ob_flush();

Thanks,

Mauro

Comments

add "die();" right after Header so the rest of the page doesn't load.

Written by Sirber

or just include the login page and die();

Written by Sirber

Accepted Answer

"You need to set and reference $_SESSION variables only." For example:

if( isset($_SESSION[$myusername]) )

From http://www.phpfreaks.com/forums/index.php?topic=263189.0

Written by zaf
This page was build to provide you fast access to the question and the direct accepted answer.
The content is written by members of the stackoverflow.com community.
It is licensed under cc-wiki