[FX.php List] Cookie issue

Jonathan Schwartz jschwartz at exit445.com
Fri Feb 22 13:34:16 MST 2008


Bob,

This was a particularly difficult issue for me, until I licked it. ;-)

Here is a sample of the code I use to manage cookies on/cookies off. 
This applies to using the header command to load another  page.  The 
syntax is slightly different for other cases, such as use in a form, 
as a link or if you need to include additional parameters other than 
the SID.


if(SID)
	{
	$url = 'file.php?'.SID;
	}else{
	$url = 'file.php';
	}
	header('Location:'.$url);
	exit;
	}


Hope that helps.

Jonathan


At 6:03 PM +0000 2/22/08, Steve Winter wrote:
>
>
>On the page where you first create the session with session_start SID then
>contains the value of the session ID, and can from that point on be used to
>append the session ID to any get or post, at which point all the session
>data, which is on the server, is available...
>
>HTH...
>
>Steve
>
>-----Original Message-----
>From: fx.php_list-bounces at mail.iviking.org
>[mailto:fx.php_list-bounces at mail.iviking.org] On Behalf Of Bob Patin
>Sent: 22 February 2008 17:55
>To: FX.php Discussion List
>Subject: Re: [FX.php List] Cookie issue
>
>I just re-read your post; it sounds like you might be saying that the 
>URL would only contain the sessionID. If that's the case though, then 
>where are all these 20 variables actually stored during the session?
>
>Time to go read the page on the PHP.net site...
>
>BP
>
>
>On Feb 22, 2008, at 11:43 AM, Leo R. Lundgren wrote:
>
>>
>>  I use the standard session setup with cookies. But it's also 
>>  possible to keep the session id (which is the piece of information 
>>  that is stored in a session cookie) floating along in links. Check 
>>  the PHP manual under the session part and you'll see some examples.
>
>_______________________________________________
>FX.php_List mailing list
>FX.php_List at mail.iviking.org
>http://www.iviking.org/mailman/listinfo/fx.php_list
>
>
>_______________________________________________
>FX.php_List mailing list
>FX.php_List at mail.iviking.org
>http://www.iviking.org/mailman/listinfo/fx.php_list


-- 
Jonathan Schwartz
Exit 445 Group
jonathan at exit445.com
http://www.exit445.com
415-381-1852


More information about the FX.php_List mailing list