SitePoint Sponsor

User Tag List

Results 1 to 3 of 3

Thread: cookie question

  1. #1
    SitePoint Enthusiast
    Join Date
    Jul 2005
    Posts
    57
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    cookie question

    hello everyone and thanks much for your past help.

    how can I have the same cookie load more than once in PHP? For example, I have a classified advertisement database and on each classified listing, I have an Add to My Classifieds link that would allow the visitor to make a custom list of classifieds he/she would like to view on a separate page for printing purposes, etc. I am setting the cookie as the Ad ID for each ad, but each time I click on a different ad, it overwrites the previous cookie, so I am ending up with just one cookie and one ad listing. How can I add multiple instances of the same cookie with different values?

    Thanks a bunch for your help!

  2. #2
    SitePoint Addict The Mog's Avatar
    Join Date
    Dec 2002
    Location
    Manchester UK
    Posts
    310
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hi


    you will have to serialize you cookie (Look at the manual)

    alternativly you could store the data in a table and call it using the cookie

    K-

  3. #3
    Keep it simple, stupid! bokehman's Avatar
    Join Date
    Jul 2005
    Posts
    1,933
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Or have an additional cookie for each item.


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
  •