Jump to content

Multiple Session_start()


djp1988
 Share

Recommended Posts

It's obviously not good practice but can having multiple session_start() in the same script mess something up ?I have a session start in my header script which i include on other pages, but sometimes I need the session variables before including the header script, and so i end up with multiple session_start()

Link to comment
Share on other sites

What I have done in the past is made a "define.php" which does the session start and defines a few variables, and then include that on the beginning of every page. Although, I don't think it affects your script by calling it twice. But yes, it is probably not a good habit of doing that.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...