| 5:31 pm on May 3, 2012 (gmt 0)|
I guess it depends on what you are doing.
My website uses session_start(); on the conf.php file, so it "broadcasts" to all pages.
| 7:04 pm on May 3, 2012 (gmt 0)|
You really don't need sessions per page unless the site requires a login of some other data that much be checked on every page. The session just binds some data on the server with a cookie in the browser and you can skip pages and it'll still reconnect.
Um, you mention this file a lot, but not everyone has one.
What are you using, Drupal? WordPress?
| 7:16 pm on May 3, 2012 (gmt 0)|
you need to call session_start() if your code uses the $_SESSION superglobal variable.
If you don't see $_SESSION used anywhere in the code, then you don't need to call session_start().
| 12:12 am on May 4, 2012 (gmt 0)|
The web is a stateless existence. You call a page, the connection between YOU and the server dies.
Sessions are how a web site's pages can stay connected to you (the browser, client) by setting a cookie in the browser and using that cookie to connect to the session files on the server. This is how you stay logged in, this is how you keep track of someone's shopping cart, this is how you maintain state across many page navigations.
Doing anything like that? Sessions=good, use them everywhere (a global include IS a good idea then.)
| 11:03 am on May 4, 2012 (gmt 0)|
@DarkEdenGenesis Iím building a social network website.
@incrediBILL Im not using Drupal or WordPress.
@httpwebwitch That makes sense. I have a few diff. scripts that have $_SESSION.
@rockabil Thanks again for your expertise clarification.
Thanks to all to responded.
| 6:21 pm on May 5, 2012 (gmt 0)|
If your web site is behind a caching server, session_start();
should force a fresh fetch of the page -- if that is important
for that page.