When to use session_start ()?

I went through several examples $_SESSION, and I'm a little confused, should I use session_start()every time before I get access or install $_SESSION['variable'], or should I use only session_start()once on the page or as soon as the user has successfully registered?

+3
source share
2 answers

Use it once per page, at the very top, before planning to use the $ _SESSION variables

+13
source

You should always use session_start()once on the page of First Lineyour PHP page if you want to access the entire session in$_SESSION

+2
source

All Articles