Creating cookies on login
-
I’m running the usermeta and userextra plugins to provide extra information in users’ profiles. I want this information to be stored inside a WordPress session/cookie so that I can pull this information in other scripts elsewhere on my site. I found that in the wordpress codex it says that WordPress users cookies to store this information. The function to create these cookies is in the ‘/wp-includes/pluggable-functions.php’ file.
I went into the function and created an additional setcookie statement inside the function to create a test dummy cookie and nothing happened. I’ve refreshed and removed the cookies and still cannot figure out why the other two cookies (for username and password) will create while my little test cookie won’t. Any ideas on how to get an extra cookie to create on login?
Here’s part of the code I’m using, this is inside the wp_setcookie function:
`
if ( $remember )
$expire = time() + 31536000;
else
$expire = 0;setcookie(USER_COOKIE, $username, $expire, $cookiepath, COOKIE_DOMAIN);
setcookie(PASS_COOKIE, $password, $expire, $cookiepath, COOKIE_DOMAIN);
setcookie(‘UserMetaZip’, ‘Test’, $expire, ‘/’, COOKIE_DOMAIN);
- The topic ‘Creating cookies on login’ is closed to new replies.