Re: two php scripts with same $_SESSION variables

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




On Thu, May 24, 2007 6:23 am, Jean-Christophe Roux wrote:
> Hello,
> I have folder A with the following php script:
> <?php
> session_start();
> $_SESSION['dummy']=10;
> echo $_SESSION['dummy'];
> ?>
> in folder B (same level as A), there is
> <?php
> session_start();
> echo $_SESSION['dummy'];
> ?>
> when running the script in B, in can see the value 10. How can I make
> sure that the $_SESSION['dummy'] is not shared between the two
> scripts? I could change the name but that would not be convenient.

http://php.net/sesssion_set_cookie_params
Second arg can be set to '/A' in folder A and '/B' in folder B and the
session will not cross that border.

-- 
Some people have a "gift" link here.
Know what I want?
I want you to buy a CD from some indie artist.
http://cdbaby.com/browse/from/lynch
Yeah, I get a buck. So?

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


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux