Re: [PHP] Looking for good tutorial on Sessions

2002-02-19 Thread Erik Price


On Tuesday, February 19, 2002, at 02:52  PM, Phillip S. Baker wrote:

 Greetings all,

 I am looking for a good tutorial on the net about sessions.
 I have found a few but they do not seem to go in much detail about full 
 use.
 Can anyone suggest anything?

How's this:

1) Put session_start() at the top of any script in which you wish to use 
sessions.

2) Use $_SESSION['varname'] = $var; to assign any variable to a 
session variable (assuming you are using PHP 4.1 or greater)

3) Keep in mind that users must have cookies enabled to store the 
session ID cookie, or you will have to plan for this by appending the 
SID to the querystring for each page in which you intend the session 
data to be accessible.

I.e. :

?php
print trtda href=\http://domain.com/index.php?SID=$SID\;Go 
Home/a/td/tr;
?

Yes, this is a pain in the ass so if you want to use sessions 
extensively you can have PHP do it automatically by recompiling PHP with 
--enable-trans-id (I think, check the man for details).

4) Read the session-related functions' man pages

It's really very simple!  With PHP 4.1, you don't even need to use 
session_register() to assign session variables, just use (2) from above.


Erik

PS:  5) when you have specific questions ask the list





Erik Price
Web Developer Temp
Media Lab, H.H. Brown
[EMAIL PROTECTED]


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] Looking for good tutorial on Sessions

2002-02-19 Thread Nick Wilson

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1


* and then Phillip S. Baker declared
 I am looking for a good tutorial on the net about sessions.
 I have found a few but they do not seem to go in much detail about full 
 use.
 Can anyone suggest anything?

Depends what you've found? There is some reasonable comprehensive stuff
on both phpbuider and devshed and I'm fairly sure there's something on
sitepoint.com

Are these the ones you've seen? 
Have you seen the manuals section on this?
- -- 
- ---
 www.explodingnet.com   |Projects, Forums and
+Articles for website owners 
- -- Nick Wilson --  |and designers.

-BEGIN PGP SIGNATURE-
Version: GnuPG v1.0.6 (GNU/Linux)

iD8DBQE8crIiHpvrrTa6L5oRAibjAJ41syisweg3ZXUsPObKeyPH03GqNQCeITYc
lqLJIjZkfNtL90j6AmJdqLA=
=QdhP
-END PGP SIGNATURE-

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php