| Welcome to WebmasterWorld Guest from 126.96.36.199 |
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
|Pubcon Platinum Sponsor 2014|
|cookies not working in wordpress|
| 10:59 am on Nov 2, 2010 (gmt 0)|
I am having difficult time handling cookies on a wordpress theme I am developing.
The site needs to drop a cookie on visitor computer so we know that the visitor has opted-in. after then we have to check that cookie value to be 1990 (eg) and then show the membership contents.
I know we can do this by using wp login system too, but for some reasons we do not want to use it. I have to do it thru cookie system so the user doesn't have to login everytime they visit.
I tried adding cookie with path/domains and without it too, but both do not work properly. sometimes it writes the cookie and does not read. sometimes it reads the old cookie.
please please help.
| 3:38 pm on Nov 2, 2010 (gmt 0)|
Most likely you are setting an invalid date string, so it's defaulting to a session cookie? Let's see the code of how you set the cookie.
| 6:11 pm on Nov 2, 2010 (gmt 0)|
Yeah I know I am doing something wrong. here is the code. I am using to set the cookie and retrieve the cookie in wordpress theme
retrieving this cookie
I read somewhere that cookies work with path and domains only in WordPress and WP doesn't allow the cookies to work without path and domain. I tried that way also, but no luck.
All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved