At 07:36 PM 8/25/00 +0100, you wrote:
Success! Thanks to Zak and the others who have helped me on
this matter. I >now have a very basic "session" working,
which will allow me to check for >multiple form submissions,
etc. I have some basic questions about sessions that aren't
that obvious (to me anyway) from the PHP manual:
1) A PHP session uses a cookie file that is stored on the
server (in the directory specified in the PHP.INI file)?
PHP Sessions correlate a unique identifier (that is stored
on the client side) with a data source (that is stored server
side). By default, the data source is a file. The location
that PHP uses to store the data files is specified in the
php.ini file.
2) No files/cookies are written on the client side when
using PHP sessions?
Either a cookie or get/post data are used to track the
session on the client side. Cookies are used by default.
The php constant SID can be use with urls and forms to
propagate the session id via get or post. There are other
mechanisms that can automatically handle passing session id
via get and post. Read the sessions manual entry for more
details.
3) I can use session declared variables to transfer values
between web pages rather than passing them via the URL
(which will prevent the URL getting cluttered)?
Yes.
4) How do I delete the session files created? For example,
"session-destroy" doesn't delete them?
An internal routine deletes old sessions. See
session.gc_probability and session.gc_maxlifetime in the
session manual entry for more information.
5) If the user closes their browser before I destroy the
session I assume the session is automatically closed?
See session.lifetime
6) If the user closes their browser before I delete the
session cookie file how do I track/delete redundant cookie
files from the server?
You will not need to do this.
7) You can only have 1 session open at any one time?
One session per user per domain. However, you can have as
many users as your hardware and connection will allow.
If anyone could answer these questions it will greatly
help my understanding on this matter.
hth
- zak