Exactly when and where should I use session_start() in PHP?
For example, say I have a login script that sets a session variable to tell whether or not t
The session_start() function can go anywhere in your code. You should just place it at the beginning of your document for consistency and call it a day. If you have a separate database or config file you are including on all your login/database driven pages, you should place it in there so you don't have to recode it into every page.