[FX.php List] Session variable problem... code

DC dan.cynosure at dbmscan.com
Sun Apr 1 13:29:50 MDT 2007


also, you say "closed browser" but in safari on the mac you actually  
have to quit safari to have it dump session cookies.

i'm sure there are browsers out there that can or will retain cookies  
(and therefore sessions) even through browser quitting. maybe it is a  
bug in the browser or some custom configuration to that browser. what  
happens with other browsers? can you see the session cookie in the  
cookie list in the browser? what does it look like right after you  
hit your page, and then after you quit the browser and open it again  
(but before going to the page), and finally what does it look like  
after you go the the page again?

BTW, sessions do (generally) use cookies "behind-the-scenes" so you  
can't say you aren't using cookies. there are php configurations that  
will use the URL to propagate sessions, but it is more common for the  
PHP session code to use cookies. however, if you are using URL based  
session propagation i'm not sure how it would detect a browser  
quit... hmmmn. i'm sure the answer is out there.

dan


On Apr 1, 2007, at 3:20 PM, Alex Gates wrote:

> You are using = instead of ==
>
> Try:
>
> if ($_SESSION['xxxx'] == 'y'){
>     echo $_SESSION['xxxx'];
> }else{
>     echo "Okay";
> }
>
>
>
> Bob Patin wrote:
>> So here's the code on the page I'm going to; I restarted my web  
>> server, on the off-chance that it would make a difference, which  
>> it didn't.
>> As a 2nd test, i went to one of my shopping carts and added stuff  
>> to the cart, then closed the browser, and as it should've, it  
>> forgot my cart entries when I returned to the site. However,  
>> everytime I go to the site quoted below, I get the value for the  
>> session variable that I've called "xxxx" below.
>> Since I'm coming from a closed browser, and this is the first page  
>> I've gone to, the IF statement should return "Okay" and not "y" as  
>> it is doing.
>> Any thoughts?
>>  Bob
>> <?php
>> session_start();
>> include_once('FX/FX.php');
>> include_once('FX/server_data.php');
>> if ($_SESSION['xxxx'] = 'y'){
>>     echo $_SESSION['xxxx'];
>> }else{
>>     echo "Okay";
>> }
>> _______________________________________________
>> 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



More information about the FX.php_List mailing list