Results 1 to 3 of 3

Thread: PHP Cookies and session variables

  1. #1

    Thread Starter
    Frenzied Member blindlizard's Avatar
    Join Date
    Feb 2001
    Location
    Austin, TX - United States of America
    Posts
    1,141

    Thumbs up PHP Cookies and session variables

    I am confused with the cookie and session functions.
    I am trying to write and read a persistant cookie. I want that when a user logs in the first time, to save their username to a cookie so that the next time they viist the site, I know who they are.
    Also, I need to keep session variables with information just about the current session. I have been reading tutorials but I am still unsure of which functions are for cookies and which are for sessions.

    Thanks
    I drink to make other people more interesting!
    [vbcode]On Error GoTo Bar[/vbcode]
    http://www.monsterlizard.com

  2. #2

    Thread Starter
    Frenzied Member blindlizard's Avatar
    Join Date
    Feb 2001
    Location
    Austin, TX - United States of America
    Posts
    1,141
    Ok, I think I have it now. Please tell me if I am wrong.
    setcookie() is used for both sessions and persistent cookies. If you give it a date, it will persist. But, if you don't give it a date it will die when the browser closes????
    I drink to make other people more interesting!
    [vbcode]On Error GoTo Bar[/vbcode]
    http://www.monsterlizard.com

  3. #3
    Fanatic Member ubunreal69's Avatar
    Join Date
    Apr 2001
    Location
    Morayfield, Australia
    Posts
    609
    ummmmm, i think thats correct. if you dont specify a date for a cookie then it will dissapear when the sessions ends

Posting Permissions

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



Click Here to Expand Forum to Full Width