Problem with setting cookies

Discussion in 'PHP' started by Snake Blisken, Feb 28, 2011.

  1. #1
    Hi Guys

    Im pulling my hair out.

    I cant get a global cookie to work.

    my set up is as follows, using joomla, with 2 different templates. on one domain.

    Site wide i have my cookie set and i fill it with a id of the pages people have viewed. All is working.

    But when i click on the home page, they are not there. not even the field name. I click back on another page, its still there filled with all my id's

    Its almost as if i have 2 seperat cookies for my site. but both are identical but the home page output is missing the ids.

    when i print the array i get as follows ( headers )


    ( this is the correct one and the site wide one )
    Cookie lastid=1243%2C1312%2C1032; mosvisitor=1; limpopo_tpl=limpopo; fontSize=100; aa0c2609=a663b

    ( this is the one that is missing id ) ( Home page output )
    Cookie mosvisitor=1; limpopo_tpl=limpopo; fontSize=100; aa0c2609=a663b

    Anybody got an idea? how do i set it site wide
     
    Snake Blisken, Feb 28, 2011 IP
  2. Snake Blisken

    Snake Blisken Peon

    Messages:
    179
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Anybody got an idea on this??
     
    Snake Blisken, Feb 28, 2011 IP
  3. Snake Blisken

    Snake Blisken Peon

    Messages:
    179
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Hi Guys, Found the solution!

    Was because i never set a path too the cookie. was taking it in a sub folder. The print_r does not show the path. so i install a add on for firebug called fire cookie, and this was able to help me see the paths and make the corrections.
     
    Snake Blisken, Mar 1, 2011 IP