Skip to main content

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
1 answer
22 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 ...
adnan's user avatar
  • 323
1 vote
0 answers
232 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 ...
Average Joe's user avatar
  • 1,879
0 votes
0 answers
412 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 ...
wplearner's user avatar
  • 489
0 votes
0 answers
541 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 ...
human's user avatar
  • 113
0 votes
1 answer
319 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 ...
Alvin's user avatar
  • 1
1 vote
1 answer
1k 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 ...
Gergely's user avatar
  • 219
4 votes
1 answer
4k 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; ...
Flimm's user avatar
  • 683
0 votes
1 answer
701 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 ...
Soothsayer92's user avatar
0 votes
0 answers
73 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 ...
FrancoisD's user avatar
0 votes
1 answer
175 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 ...
DevHelp's user avatar
0 votes
1 answer
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....
AFA Med's user avatar
  • 183
2 votes
1 answer
222 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. ...
Paulo's user avatar
  • 21
1 vote
2 answers
52 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 ...
DarkMatterMatters's user avatar
-1 votes
1 answer
1k 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: ...
Jessica Hawkins's user avatar
6 votes
2 answers
11k 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:...
Minh Tri's user avatar
  • 3,419
0 votes
2 answers
487 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 ...
user3645783's user avatar
1 vote
2 answers
2k 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/...
W. White's user avatar
  • 107
1 vote
1 answer
729 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('...
Edward's user avatar
  • 439
1 vote
2 answers
2k 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 ...
user117689's user avatar
1 vote
1 answer
1k 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!&...
geoB's user avatar
  • 127
0 votes
1 answer
28 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 ...
Andrew Smart's user avatar
1 vote
0 answers
28 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
MisterCocktail's user avatar
1 vote
0 answers
1k 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(...
Zisis Paparidis's user avatar
0 votes
1 answer
738 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 ...
M0n5terBunny's user avatar
0 votes
1 answer
105 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. (...
Patrick's user avatar
  • 295
21 votes
15 answers
31k views

Cookies in Multisite network where sites have their own domain name?

I decided to integrate several standalone WordPress websites into a single Multisite installation. I created a brand new Multisite install with subdomains, created a MU network site with subdomain URL,...
Steve's user avatar
  • 1,707
1 vote
0 answers
1k 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-...
user3622260's user avatar
1 vote
0 answers
824 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 ...
poto's user avatar
  • 23
5 votes
2 answers
3k 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 ...
JpaytonWPD's user avatar
0 votes
2 answers
512 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 ...
user avatar
1 vote
2 answers
8k 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 ...
Francesco Martelli's user avatar
0 votes
1 answer
111 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 ...
Francesco Martelli's user avatar
0 votes
2 answers
2k 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'...
roland_katona's user avatar
3 votes
2 answers
7k 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 ...
Paul Hill's user avatar
0 votes
2 answers
2k 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 $...
Francesco Martelli's user avatar
-1 votes
1 answer
4k 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' => $...
Kode Bryant's user avatar
0 votes
2 answers
3k 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,...
rorymorris89's user avatar
1 vote
2 answers
1k 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?
Knott's user avatar
  • 454
0 votes
1 answer
229 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/...
timholz's user avatar
  • 151
0 votes
0 answers
120 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']) ); ...
MediaFormat's user avatar
24 votes
1 answer
2k 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 ...
CK MacLeod's user avatar
  • 1,857
0 votes
1 answer
160 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)); ...
Ritesh's user avatar
  • 101
2 votes
2 answers
5k 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 ...
Jake Wilson's user avatar
4 votes
0 answers
2k 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 ...
looloobs's user avatar
  • 141
0 votes
1 answer
464 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 ...
theyuv's user avatar
  • 209
3 votes
1 answer
9k 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 ...
Lucio Crusca's user avatar
7 votes
2 answers
3k 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 ...
Michael Ecklund's user avatar
2 votes
2 answers
776 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 ...
Abdulrahman Hassoun's user avatar
1 vote
1 answer
2k 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. ...
Phil Birnie's user avatar
-6 votes
1 answer
299 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 ...
churryramirez's user avatar

1 2 3
4
5
8