Hi,
I'm relatively new to PHP. Writing small scripts, at some point I realised I needed a login script. I started reading tutorials and the manual about sessions, and I have a few questions:
1. Can you end a session?
Besides session_destroy(); which unsets all the vars/array(s).
2. Do you need to manually set cookies or does session_start(); do that?
Also, does the cookie have info realtive to the script or some sort of way to identify which script started the session?
I am asking this because if I used session_start(); in any window of the browser that had dealt with another session in my scripts (in the short past of some minutes), session_start(); would use the existing session.
It sortof gave me the feeling that any (php) script that I would enter in that browser would use the same session(!) , something that I hope is not true.
Please someone with a good deal of knowledge on sessions explain!
Thanks a lot in advance,
Xelmepa.
Session questions
Moderator: General Moderators
1. To end an session you use use both session_destroy(); and session_unset();
2. Sessions in default does not use cookies they store the information in the specified folder which is set in php.ini. Also you would not know which file has started the session but the session cannot be used by any other sites.
2. Sessions in default does not use cookies they store the information in the specified folder which is set in php.ini. Also you would not know which file has started the session but the session cannot be used by any other sites.