Skip to content

Instantly share code, notes, and snippets.

@alash3al
Last active August 29, 2015 14:07
Show Gist options
  • Save alash3al/50db9ffb608b6e10c251 to your computer and use it in GitHub Desktop.
Save alash3al/50db9ffb608b6e10c251 to your computer and use it in GitHub Desktop.
better than session_start()
<?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