Forum Moderators: coopster
thanks in advance!
As of now, calling session_start() while the session has already been started will result in an error of level E_NOTICE. Also, the second session start will simply be ignored.
does that mean I dont have to care about putting a code to prevent start my session twice or I should of?
It means that there are problems with the way you have coded your login system. I hope this doesn't sound harsh, but I would be very wary of implementing a login system that triggered these kinds of log entries.
If you need to use a session variable before the header is included, I suggest you take the session_start() out of your header and add it into a different include page that you put at the very top of all of your .php pages.
If it's really an issue, your users may see a warning, so you would probably have to change your settings in PHP to disable warnings.
rob7591: Thanks for the help, I guess i will just use the session_start when i just need it but calling a function instead, so this function will have the code to prevent the page to start a session if its running already. Not sure how good this can be but according to what Receptional Andy said in his first post and those warnings you are mentioning I think it will be the right way. Anyway the way im changing the code right now Im almost sure i never call session_start more than once but just in case :P
Your answer is not better than my question. but thanks anyways.
Charmed, I'm sure. charlee: the point I was making was that ignoring E_NOTICE will be at your peril - personally, I would not implement a login system without understanding the consequences of this error.