• Resolved Cory.Nickerson

    (@corynickerson)


    I’m making my own custom login page and functions and just need to know how to write the data for the cookies. I did var_dump($_COOKIE) and came up with this info which is stored in cookies.

    array(4) {
    	["wordpress_test_cookie"] => string(15) "WP Cookie check"
    	["wordpress_logged_in_26136172b2949242d677f08fc280dbe6"]=> string(49) "Admin|1375480283|95c9b58b40883cb2b196138f1e45a8d9"
    	["wp-settings-time-1"]=> string(10) "1374790168"
    	["PHPSESSID"]=> string(26) "bbq3v8s3gk0qtsiggdf0j3q362"
    }

    What does each one do and how are they created?

    Thanks

Viewing 1 replies (of 1 total)
  • Moderator bcworkz

    (@bcworkz)

    The test cookie comes from here. I believe it’s purpose is just to make sure the client is accepting cookies before wasting any more time on the request.

    The remainder probably come from here. They essentially ensure the requests are from a legitimately logged in user and allows the user to remain logged in for a reasonable time without having to log in again.

    The values are hashes of unique strings, making it virtually impossible for a bad actor to fake the cookies in order to gain access to the site. You should be able to set these by simply calling wp_set_auth_cookie().

Viewing 1 replies (of 1 total)
  • The topic ‘Custom Login & WordPress Cookies’ is closed to new replies.