SitePoint Sponsor

User Tag List

Results 1 to 3 of 3

Thread: PHP Cookies

  1. #1
    SitePoint Enthusiast
    Join Date
    Jul 2000
    Location
    Australia
    Posts
    67
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    PHP Cookies

    I am after a way of createing a cookies that contain user information from php code.

    The site that this is for is ChristExplained.NET

    If anyone know how to do this without resorting to php sessions it would be of greate help

    (with PHP sessions, the user would be required to login each time they visit the site)

    Later,
    WebmasterMattD
    WebmasterMattD.NET

  2. #2
    SitePoint Wizard gold trophysilver trophy
    Join Date
    Nov 2000
    Location
    Switzerland
    Posts
    2,479
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Personally think the best way to do this would be by combining sessions and cookies.

    Build your security system around sessions. Then the first time someone logs in, or when they register, you send them a cookie ( see setcookie) which stores the userid and password (perhaps you should let people choose whether they want this cookie or not - some people may be sharing computers).

    Next time they visit the login page, it checks to see if the userid / password variables are already set (i.e. checks the cookie you set). It then starts the sessions with these variables.

    Plenty about doing sessions here

  3. #3
    SitePoint Enthusiast z00om's Avatar
    Join Date
    Dec 2001
    Location
    California
    Posts
    86
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    again, due to the changing standards, don't forget to call session/cookie data like this:

    $_SESSION['session_data']
    and
    $_COOKIE['cookie_name']

    other than that it looks like you've got all you need!

    Good luck, have a nice day
    [z00om : home]
    [z00om@hotmail.com]
    [z00om : aim]
    [77968493 : icq]


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
  •