Questions tagged [cookies]

An HTTP cookie is a small piece of data sent from a website and stored in the user's web browser while the user is browsing it.

Filter by
Sorted by
Tagged with
0
votes
1answer
36 views

store URL global before we redirect

I am using wp_redirect ( get_permalink ( $post->ID ) ); to redirect users to variable (random) posts I need to know if the user redirected to current post from specific URL or not Is it possible ...
0
votes
1answer
18 views

detect referr page

I made custom template to randomly redirect users to posts with specific args I need to know if users reach the post from this page link or from another one I tried wp_get_referer(); but it's get ...
1
vote
0answers
132 views

Wordpress authentication cookie and ajax calls

I'm up against a challenge. I got a WordPress website where users sign up to the website using the built-in WordPress user login system. And as you may know, this places a WordPress authentication ...
0
votes
0answers
268 views

Cookies error during first time login attempt

I have a custom login url and when i am trying to login for first time it displays error "ERROR: Cookies are blocked or not supported by your browser.". Although It works second time. I have discussed ...
0
votes
0answers
449 views

Single sign on to sub-sites in Multisite Network

I have a Multisite Network setup which consists in a primary site under https:// and many sub-sites under http:// Supposedly, WordPress should automatically handle the cookies so that when a user ...
0
votes
1answer
147 views

Share login status across subdomains without network

I need to share login status across subdomains in one install. For example, after I login in main site: localhost/dx/, but when I visit test.localhost/dx/ (I remove 'redirect_canonical' to stop ...
1
vote
1answer
555 views

wp_validate_logged_in_cookie

I would like to understand this function, its purpose and its working. https://developer.wordpress.org/reference/functions/wp_validate_logged_in_cookie/ writes that Checks the logged-in cookie if ...
2
votes
1answer
2k views

Should wordpress_logged_in cookie exist while logged out?

I noticed that while logged out on my Wordpress site, my browser is sending this Cookie header with every request (obfuscated for security): Cookie: wordpress_logged_in_OBFUSCATED=flimm%7COBFUSCATED; ...
0
votes
1answer
378 views

admin-ajax.php not working properly on subdomains

I am trying to multiply product price (pulled from database) by, corresponding to switched language, cookie-stored currency. To achieve this I am using AJAX script and several methods. Problem is with ...
0
votes
0answers
36 views

Cookie set in a plugin visible in admin but not on front

I have created a cookie in a plugin with the basic PHP function setcookie(). This cookie is in a function. I can see the cookie in my browser console in admin but not on front. I added just after ...
0
votes
1answer
117 views

Looking to load a different template part on every load/refresh

I basically have a site where I have several different template headers that I want to load via get_template_part. The basic idea is when someone first visits the site, they should see a random ...
0
votes
1answer
5k views

How to set a Cookie-Free Domain with WordPress?

I recently set up a WordPress site here. I added these two lines in wp-config.php: define("COOKIE_DOMAIN", "www.artisanplombier-pascher.com"); define("WP_CONTENT_URL", "https://static....
2
votes
1answer
103 views

Random popup image per user with no repeat

I am pulling images from an ACF gallery that resides on another page. What I intend to do with this is to have these images displaying full screen on my home page on a popup every time the page loads. ...
1
vote
2answers
44 views

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 ...
0
votes
1answer
830 views

Allow user to select location and then set cookie for location in WordPress

I am needing to allow a user to select a location from a dropdown on the front-end, that then sets a session cookie for that chosen location... any help here? Ok so this is the outlined task: ...
4
votes
2answers
7k views

How does REST API cookie authentication work in WP 4.7?

Though I have logged in, I cannot create a post on frontend. WordPress always return 401 Unauthorized response. I have dumped $_COOKIE to make sure logged-in cookie was set and got something like this:...
0
votes
2answers
135 views

Page specific cookie

I have created a landing page that is only available to a certain audience. When users visit this page I would like to create a cookie that can be passed on upon completing a booking form on another ...
1
vote
2answers
1k views

How am I able to get the value out of cookie array when I push a button?

I have made a favorite plugin. With a shortcode I'm able to display the button to 'a wish/favorite list' anywhere I want the button. This button is for adding the post_IDs of pages/posts/blogs/...
1
vote
1answer
220 views

Will setcookie work if there is a cache plugin installed?

A cache plugin in WP will cache PHP output, but does it include HTTP header? For example, add a piece of code as following: add_action('wp', 'my_cookie' ); function my_cookie() { setcookie('...
1
vote
1answer
881 views

After logout browser's back button into twenty sixteen theme profile

I have tried numerous ways to prevent the browser's back button from allowing someone from using it to go back into a visitors logged out profile. The codes I used were supposed to prevent the browser ...
0
votes
1answer
873 views

Cookie is not set

A member sign-in form is processed in the theme's functions.php with the code below. For a test, when good credentials are entered in the form, the process is stopped with die("I LIKE COOKIE!");. So ...
0
votes
1answer
24 views

Capture and display users name

Can anyone tel me if a plug-in exists that can do the following: Check is it's the users first visit, if so the user will be prompted to input their first name into a text field. Their name will then ...
1
vote
0answers
23 views

COOKIE_ID with username appended

Good evening, could you tell me how I can add to the cookie name of the user logged in wp in this code? COOKIE_ID = const 'mnp_'; I wish the result was like "mnp_Antony" Thanks for the help
1
vote
0answers
576 views

Delete cookie when changing url (when navigating away from specific page of website)

I am working on a wordpress website with woocommerce. In my cart.php I defined a javascript cookie as I want to store some choices that a user does on this specific page. The code is jQuery(...
0
votes
1answer
471 views

Why isn't my cookie setting in my function?

Ive got a very simple function that simply sends mail using values from the form. Everything works, tthe values get passed through to the wp_mail and it gets sent out no issue. But for some reason ...
0
votes
1answer
26 views

Notify user we would like them to clear their cookie. Provide a working button to clear cookies for user

Explination: We are facing some issues with logged in users being able to checkout via wordpress's woocommerce. The fix for these few users that reached out to us was to simply clear their cookies. (...
1
vote
0answers
528 views

iframe does not store session/cookie when refresh parent

I have been searching around but there was no specific answer or any indication about the problem I am facing. I have a domain, parent.com, which is just a full screen container of a WordPress-...
1
vote
0answers
483 views

Setting Cookies For Form Autofill

I'm trying to set cookies on a gravity form submission to collect and store information submitted on one form and fill in the information on another form as well as filling out the original form again ...
5
votes
2answers
1k views

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 ...
0
votes
2answers
126 views

How can I save cookies to members

I have a site that has a membership. Currently, we allow customization of preset themes. This uses cookies, however I want my users to have the same theme across all of their devices. I want to be ...
0
votes
2answers
1k views

How to run a function in every page, every device

I need to run a function on my Wordpress, on every page of the site you'll visit, on every device, and template used (PC, Tablet, Mobile, ...). This function will check if a Cookie has been set. If ...
0
votes
1answer
36 views

Let Wordpress to go opening an external URL

I need to let my WP site go external with some links. I've got this variable in function.php $link=<a href=". $_COOKIE['link'] .">TEXT SHOWN</a> Where $_COOKIE['link'] contains a ...
0
votes
1answer
764 views

Blurry images when loading the page first time

When first time opening http://plenuum.com/ the images are blurry and become sharp only after a Command+R. I've tried but could not fix it with WP plugins. Any idea how to solve it? Thanks (We'...
3
votes
1answer
4k views

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 ...
0
votes
2answers
692 views

How to set cookies

I need to set 1 cookie, saving a data sent from a form. I see that I have to hook my setcookie() to the 'init'. That's OK. add_action( 'init', 'cookie_function'); My 'cookie_function' will have $...
-1
votes
1answer
2k views

Cookie not created in AJAX request

I'm trying to set a cookie by php on a user interaction function promo_signup () { $ip = get_client_ip(); $entry = [ 'firstname' => $_POST['firstname'], 'lastname' => $...
0
votes
1answer
1k views

Setting cookies in WP REST API requests

I'm trying to use setcookie inside a WP REST request, but it isn't working. The REST request runs properly and performs it's other duties well, but it doesn't set any cookies. Here's my example code,...
1
vote
2answers
564 views

How to Highlight unread WordPress posts?

I need to show a new post marker for unread posts, placed after its date as is shown in the image below: Any tips?
0
votes
1answer
136 views

cookie free subdomain and @font-face

I've set up a cookie-free subdomain. In my css i use @font-face: @font-face { font-family: Butterfly Kids; src:url(fonts/butterfly/Butterfly-Kids.ttf.woff) format('woff'), url(fonts/butterfly/...
0
votes
0answers
56 views

mu-plugins body_class filter not working

So this code was working fine in mu-plugins until an update back in september or so... function save_cookie_class( $classes ) { array_push( $classes, isset($_COOKIE['some_cookie']) ); ...
23
votes
1answer
1k views

Is this Solution for Caches vs Cookies Going to Get Me in Trouble?

I've come up with a provisional solution for a not exactly common, but far from unprecedented problem with the interaction of popular WP caching solutions with cookies, in this case the standard WP ...
0
votes
1answer
150 views

Why setcookie function redirecting to home page in wordpress?

I have build a plugin in which i have used setcookie like this : function myFunctionAbc () { $response = wp_remote_get('http://my/request/url/', array('timeout' => 240, 'decompress' => false)); ...
1
vote
2answers
3k views

Gravity Forms skip form if already filled out using cookie?

I have a Gravity Forms page set up where, after you fill out the form, you are taken to a confirmation page where you can download some resources. The problem with this setup is: Let's say someone ...
4
votes
0answers
1k views

Setting Cookie Using a Variable from the URL

I need to hand code an affiliate link (we do not want to use an existing plugin). I do not do a lot of coding, so bear with me. It seems so simple I have a link: http://www.domain.com/?code=8765 ...
0
votes
1answer
202 views

Removing wordpress cookie from non-wordpress site

I am using wordpress for a blog on my site. So I installed wordpress in a subdirectory (eg: www.example.com/blog). I handle all of the sign in/sign out through my main site. For signing in I set a ...
3
votes
1answer
6k views

Getting “Cookies are blocked or not supported by your browser” on login page

I've got a WP installation at server-a.example.com (serverA) and I want to duplicate it on a different server which is server-b.example.com (serverB). My steps are: Copy database Copy files No need ...
6
votes
2answers
2k views

How to Layer 7 Load Balance WordPress Backend and Frontend?

I've got a Layer 7 Load Balancer setup using HAProxy for WordPress Multisite. I'm looking to have anything related to the WordPress backend to be served from a specific group of servers (A/K/A ...
2
votes
2answers
497 views

Can't login after URL change

I changed the settings first, then relocated WP to another location. Now I can't access wp-admin ERROR: Cookies are blocked or not supported by your browser. You must enable cookies to use ...
1
vote
1answer
1k views

Unset a Cookie on Successful Gravity Forms form Submission [closed]

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. ...
-6
votes
1answer
201 views

How to include landing page with form submission?

I'm referring users to a Wordpress site with urls that correspond with various landing pages. I need an application form submission to include the landing page url the visitor used. How can this be ...

1 2 3 4 5 7