Advanced Search

Results 1 to 2 of 2

Thread: bad experience with cookies

  1. #1
    Join Date
    Feb 2009
    Posts
    156
    Thanks
    0
    Thanked 4 Times in 3 Posts

    Default bad experience with cookies

    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....


    PHP Code:
     if(isset($_COOKIE['modelid']))
        {

               
    $selmodel    =    $_COOKIE[modelid];
        }
        else
        {
            
    $selmodel ='No Model Selected';
        } 
    this code is used

  2. #2
    Join Date
    May 2007
    Location
    Boston,ma
    Posts
    2,127
    Thanks
    173
    Thanked 207 Times in 205 Posts

    Default

    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.

    PHP Code:
    $_COOKIE['modelid'
    Corrections to my coding/thoughts welcome.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •