Using session_start(); on every page
Posted: Wed Sep 17, 2008 5:19 pm
Hey gang,
I've been working on a website that is a compilation of various php scripts that do different things... all of which is written with php/mysql. I use a header template file that is used for every single php page I create, and that header template contains only two things.. ob_start() and session_start().
So every php script on this website has session_start() called. But only about 15-20% of the php pages (couple hundred php files total) actually use session variables. I just figured I'd let any php page I create call session_start() just in case in the future I'd need it.
Is there any real harm to calling session_start() for every php page I create? Even though I don't actually use sessions on 80% of those pages? Since I'm no pro, I just want someone to tell me that this is acceptable and not heavily frowned upon.
Thank you for all your guidance and advice. Take care.
I've been working on a website that is a compilation of various php scripts that do different things... all of which is written with php/mysql. I use a header template file that is used for every single php page I create, and that header template contains only two things.. ob_start() and session_start().
So every php script on this website has session_start() called. But only about 15-20% of the php pages (couple hundred php files total) actually use session variables. I just figured I'd let any php page I create call session_start() just in case in the future I'd need it.
Is there any real harm to calling session_start() for every php page I create? Even though I don't actually use sessions on 80% of those pages? Since I'm no pro, I just want someone to tell me that this is acceptable and not heavily frowned upon.
Thank you for all your guidance and advice. Take care.