Session questions
Posted: Sat Aug 24, 2002 3:02 pm
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.
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.