dariush Posted February 2, 2012 Share Posted February 2, 2012 hey guys i'am newb in php and i'am doing some algorithm in php, in some codes i need to use session but in that particular page the code does not know if session_start has been called or not. wonder to if there is anyway that i can get if session is started or not in my code? thanks in advance Quote Link to comment https://forums.phpfreaks.com/topic/256274-how-to-know-if-session-is-started-already-in-page-or-not/ Share on other sites More sharing options...
Alexv Posted February 2, 2012 Share Posted February 2, 2012 Maybe this is what you are looking for. http://www.php.net/manual/en/function.session-status.php Quote Link to comment https://forums.phpfreaks.com/topic/256274-how-to-know-if-session-is-started-already-in-page-or-not/#findComment-1313765 Share on other sites More sharing options...
Pikachu2000 Posted February 2, 2012 Share Posted February 2, 2012 Or for php 5.3.x or less, isset($_SESSION) will return a TRUE/FALSE value. Quote Link to comment https://forums.phpfreaks.com/topic/256274-how-to-know-if-session-is-started-already-in-page-or-not/#findComment-1313771 Share on other sites More sharing options...
dariush Posted February 2, 2012 Author Share Posted February 2, 2012 Or for php 5.3.x or less, isset($_SESSION) will return a TRUE/FALSE value. thanks isset($_SESSION) worked well Quote Link to comment https://forums.phpfreaks.com/topic/256274-how-to-know-if-session-is-started-already-in-page-or-not/#findComment-1313783 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.