Articles of cookies

Unset a Cookie on Successful Gravity Forms form Submission

I have a cookie with data that I’m utilizing to populate a Gravity Forms form. However, after the form has been successfully submitted, I’d like to unset (or more accurately, expire) that cookie. What I’ve tried Initially, I thought the gform_after_submission hook would work. I tried simply that pointing to a function that does the […]

Show greetings on first time visitors?

This seems pretty straightforward using cookies in straight HTML. In wordpress, how do I do this? AFAIK, wordpress only provides cookies functions for logging/logged in users. How about when I don’t want the user to log in to show my greetings?

Set authentication cookies to be shorter but then extend with every page load

I’m trying to get around the otherwise very insecure way of WordPress handling authentication cookies. I mean, having the cookie expire in 2 weeks only if I build a membership site is obviously not ok, but at the same time, making it expire in 15 minutes while the user is logged in would be more […]

Get wordpress stored cookies for custom login

I’ve created a custom login box. I’m using wp_signon() method. Everything works well. Also i have a Remember me checkbox so i can remember user credentials next time. I know i can do it my own way of handling cookies but i want know is there any wordpress builtin method to get cookies. This is […]

Set cookie using GET variable

I need to set a cookie based on a GET variable so my customers can get a coupon code on our site even if they move around after selecting the coupon link. I am using the code here: Gravity Help to populate the coupon field based on the cookie. Just the second half of the […]

ERROR: Cookies are blocked or not supported by your browser

I’m getting this error while trying to log in: ERROR: Cookies are blocked or not supported by your browser. You must enable cookies to use WordPress. Yet I have cookies enabled and not blocked. I’ve tried this on a few different browsers, and in the incognito/private modes of those browsers, too, and get the same […]

Two posts are loaded instead of one?

I am trying to add a read posts function to my WordPress website. To achieve this, I create a cookie on which I store all the IDs of read posts. Every time a post is loaded, the following function is fired : function readPosts() { if (is_single()){ $postId = get_the_id() . “/”; $cookie = empty($_COOKIE[‘readposts’]) […]

How to resolve error “Cookies are blocked due to unexpected output.”?

I am facing an error as per below at admin panel login. “ERROR: Cookies are blocked due to unexpected output.” I’ve tried several solutions like, Log checking (No logs are showing in log file) Resolve header already sent issue (Not getting this error at all). Check incomplete ‘php tag‘, removing white spaces etc (Have already […]

Logins through alias

My site is hosted by a university that runs all external traffic through an alias. The actual URL of the server is accessible only on campus. Right now I have the site address set to the alias and the wordpress address is the real server (to make that work I had to make several manual […]

Share WordPress Login Cookies Between Two Subdomain Installs

I have two wordpress installs each on their own sub domain. sub1.domain.com and sub2.domain.com I want to share the login information between sub1 and sub2. I already have configured them to use the same MySQL database, and they use the same database table. I am able to log in on both websites with the same […]