Log in

View Full Version : bad experience with cookies



gurmeet
02-13-2011, 03:54 PM
hi friends..
i am using cookie on m web page, a value is stored in cookie ,after that , the value is reterieved from the cookie and used in web page...

all is going well...

but when i open any link in other tab of my browser, ( means a same page in two tabs), in new tab it doesnot show the value of cookie....



if(isset($_COOKIE['modelid']))
{

$selmodel = $_COOKIE[modelid];
}
else
{
$selmodel ='No Model Selected';
}

this code is used

bluewalrus
02-13-2011, 04:55 PM
Are you at the same addresses, both http://www.site.com or http://site.com?

Try putting the key in quotes when setting its value.


$_COOKIE['modelid']