Last active
August 29, 2015 14:07
-
-
Save alash3al/50db9ffb608b6e10c251 to your computer and use it in GitHub Desktop.
better than session_start()
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Session initializer | |
* this function will check whether the session already started or not | |
* if it started then it will not start it again | |
* @author Mohammed Al Ashaal | |
*/ | |
function session_init() | |
{ | |
return session_id() == '' ? session_start() : true; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment