Hudzilla.org - the homepage of Paul Hudson
Contents > Cookies and Sessions Wish List | Report Bug | About Me ]

10.3     Using sessions

This is NOT the latest copy of this book; click here for the latest version.

Sessions are great for storing temporary data about your visitors, particularly when you do not want that data to be accessible from outside of your server. Using sessions before PHP 4.1 was much harder than it is today - if you are used to having to use functions to set and unset session variables, you should pay extra-special attention to this text on sessions, because things have changed substantially as a result of the superglobal $_SESSION array.





<< 10.2 Using cookies: setcookie()   10.3.1 Starting a session: session_start() >>
Table of Contents
Want to see this stuff in print? PHP in a Nutshell takes the core topics covered here, adds in thousands of edits from the editorial team and myself, and combines them to make an unbeatable reference for PHP programmers at all levels.



My latest book has hundreds more tips on how to use PHP, Apache, and MySQL, plus Perl, Python, shell scripts, performance tuning, and more!



Top-right shadow
 
Bottom-left shadow Bottom shadow

Comments from other readers
michael@xorgonix.com - 06 Sep 2008

The posting above was made back in about 2002... for some reason the owner of this site keeps refreshing the date to make it appear like the posting was just made... ok, not a biggy, but i am curious as to why he has ignored emails asking him to stop that.

michael@xorgonix.com - 06 Sep 2008

what a great site!

my only comment for the session/cookie part was a bit of discussion of the length of life of these objects, and how and why you'e set 'em a certain way.

have to say i really like the level, and the language of the book. i've been working with php for a while now, but some of the "grey" areas have been brightened up quite a bit by your writing.

Thanks!

michael



Add comment
Please note that by posting a comment here you are committing it to the public domain. This is important so that others can make use of your code themselves, and also so that I can incorporate helpful notes directly into the main text. Comments are limited to 2000 characters in length.

If you are reporting an error in the content, please tell me directly.

Your name/email address:
Your comment:
 
Now, in order to verify that you're a real person, please answer this simple question: what is three plus two?
The answer is:
(please write in
numbers, eg 19)


Top-right shadow
 
Bottom-left shadow Bottom shadow