SitePoint Sponsor

User Tag List

Results 1 to 3 of 3

Thread: Yummie cookies

  1. #1
    SitePoint Enthusiast
    Join Date
    Aug 2001
    Location
    London, England
    Posts
    44
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Yummie cookies

    I'm trying to work out how to get a cookie I made to be usable.

    I've never learnt any other language before PHP do I've never really learnt sessions and cookies so I've been having a nightmare understanding them
    I've got everything right it's putting the data in the database and making a server session etc...

    Anyway, I need to be able to get a session id i put in a user cookie, I set the cookie up like
    PHP Code:
    setcookie("sessid"$sidtime()+43200"/"""0); 
    And don't know how to get the data back.

    I've tryed using $HTTP_COOKIE_VARS['sessid'] and it don't seem to work. I guess I gotta use session_get_cookie_params() but I don't know how to use it.

    Please help before I die from stress

  2. #2
    SitePoint Evangelist
    Join Date
    Oct 2000
    Posts
    430
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    If the cookie is set correctly you don't actually need to do anything to 'get the cookie back' - if you set the cookie
    PHP Code:
     setcookie("sessid"$sidtime()+43200"/"""0); 
    To use it you can just use $sessid.

  3. #3
    SitePoint Enthusiast
    Join Date
    Aug 2001
    Location
    London, England
    Posts
    44
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Cheers dunno spose I'm just dumb lol.
    I tryed echo $sessid; and it showed, there must be an error somewhere else in my code to why its not using it


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
  •