Jump to content

Can I define a session variable before session_start()?


suckerpunch

Recommended Posts

I believe that you can put the session_start below the first line AS LONG AS you have no output to the browser before the session_start. If you have output to the browser then the header has already been sent and you get an error to that effect so it is usually good practice to put it right at the top.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.