A message from our CEO about the future of Stack Overflow and Stack Exchange. Read now.

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
-1
votes
0answers
21 views

How to check if guest has placed an order?

I need to check if a guest has placed an order, then show specified text for him if yes. I know how to search orders by MySQL queries, but have no idea about guests. Any ideas how to identify guests? ...
0
votes
0answers
12 views

Where does the cookie mo_page_views_counter come from?

mo_page_views_counter: 3 mo_has_visited: true mo_is_new: true I have the following cookies set on my wordpress site... However I do not set these cookies and I have turned off all plugins that might ...
0
votes
0answers
12 views

Problems with my site cookies

I have to adapt my website to the European cookies policy. The fact is that with the plugin that I have installed, if I reject third-party cookies they still appear. And if I reject them all, it still ...
0
votes
0answers
29 views

Update Code to be Compatible with WP 5.3 ('cannot modify header information' warning)

The following function that we have in a plugin a developer helped us create (he is no longer available) is giving errors when debugging is on once we updated the site from WP 4.9 to WP 5.3. Wondering ...
0
votes
0answers
22 views

iframe token flow for SSO OAUTH2

I run a Wordpress site (page A), locally in the company network. A login is required on the site. Our Company SSO via OIDC / OAUTH2 is implemented and working. The intranet also works with our ...
2
votes
1answer
31 views

Popup Cookie Wordpress select language and section (Elementor)

I need to show a popup where the user can choose the language and which section to open (partners, customers, support) and that this choice is kept in the cookies so that the next time he returns that ...
0
votes
0answers
23 views

Checking for cookies returns correct result only inside Elementor Editor

I want to allow the user to download the posts(show list of posts) only when they have submitted the lead gen form, which in turn adds the cookies in their browser. Now whenever someone fills the ...
0
votes
0answers
7 views

How to share user session/cookie within single Wordpress installation for multiple domains?

I have got a single Wordpress installation. I am using multiple domains for local languages, based on the domain I display translated text within the same theme. domain1.com for English domain2.de ...
0
votes
1answer
18 views

set cookies on certain page only

I am trying to set a cookie on Wordpress on a certain page only. I've tried a LOT of different ideas but still can't get it to work as 'init' is called before the page is set. This is my current code:...
1
vote
2answers
22 views

WordPress Light/Dark Theme best practices? Is there a way that really works?

We currently have a light/dark theme enabled on our WordPress site using cookies and a .dark class in CSS. It works, but makes using WP Total Cache almost not worth it as any post/page using the ...
0
votes
0answers
24 views

Using auth_cookie_expiration to extend session timeout doesn't work

I'm trying to extend the session timeout in our WP based site (default timeout is too short for our users). For this purpose, tried to add a code snippet using auth_cookie_expiration to functions.php, ...
0
votes
0answers
11 views

Is identity impersonation by cookie the go-to when trying to gain fast access in WordPress?

I'm trying to write a system that would allow me to access a WordPress website if the administrator chooses to share a link with me. That link, GPG-signed are his cookies, that I can then use to hit ...
0
votes
0answers
27 views

Wordpress Admin login redirect to homepage

Wordpress admin page redirecting to home page after login, not at all see any admin area. For the console, it is showing 32 redirects. but not sure why it is happening For the console header, it is ...
0
votes
0answers
18 views

What is the function that sets login cookies on WordPress?

I tried to look for everything on Google but I had little luck. I created a login and registration form on the same page before making a purchase if you are not logged in. To log in, use the ...
0
votes
0answers
20 views

Reset cookie for login, register and logout

I would like to better understand how WordPress login / logout cookies work. In my case I have a page that allows you to perform various operations. To see if the user is not logged in I perform the ...
0
votes
0answers
14 views

Understanding if the user logged in using the Login form of through cookie authentication

Well, it's all in the title. I hooked in wp_login, but as far as I have been able to understand from documentation this hook is alwasy fired when the user has logged in regardless of how -if a normal ...
1
vote
1answer
58 views

Passing a borrowed nonce through Postman fails

I'm trying to test borrowing a nonce from my browser session so that I can use it elsewhere, namely in my npm dev environment. I took a nonce passed into an open Chrome browser session, put it in a ...
0
votes
0answers
21 views

wp-cron event doesn't run when custom login API is enabled

I have a cron job on my wordpress site. which I would like to run every hour. I also have a custom login function on my site: users are directed to my site via another site which passes login ...
0
votes
0answers
26 views

Multsite /wp-admin/network/ always redirect to login page

My Wordpress multisite has 2 sites: www.example.com (SiteID #1) www.example.com/es(SiteID #2) The Network Manager is under www.example.com/wp-admin/network/ When I try to perform ANY action (Like ...
0
votes
0answers
22 views

Comment Form Fields when user logged in

WordPress comments form automatically detects the name and email if you logged in. I want to disable this feature by adding a code snippet. The name and email fields should be filled by users and even ...
0
votes
1answer
26 views

How do I stop exactly one blog from network ever setting cookies?

I have a multisite with each blog on a subdomain. I plan to create another site (let's say blog92.example.com) which I will tell the main site to serve images from - pretty much as per this question. ...
0
votes
0answers
46 views

Display an image using path from value set in cookie

I was wondering if anybody could help me please. I've been struggling with this for a couple of days and running out of steam. Google isn't so great now either :/ I'm trying to display an image on ...
1
vote
0answers
18 views

Need help setting cookies with multiple value [closed]

im having troubles with setting cookies in my website (since its the first time using them). Basicly i have this form on a article page: <form method="POST" action=""> <input type="...
0
votes
0answers
14 views

Can't setcookie in reset passsword

I'm with a problem while setting cookies in this native Woocommerce function: public static function set_reset_password_cookie( $value = '' ) { $rp_cookie = 'wp-resetpass-' . COOKIEHASH; $...
0
votes
1answer
15 views

How to save history in the client's browser without login? [closed]

I know that we can use some snippets or plugins to save the client history but this work for the login clients as I know. My question is how to do the same thing but for unlogin users. Let's say I am ...
0
votes
1answer
343 views

Set A Cookie To URL Parameter, Pass Cookie From Page To Page To Alter Post

I have a function that makes the post multipage based on a URL Parameter with a specific value: ?content=multipage The problem is that when a user clicks to the next page the URL parameter is ...
0
votes
1answer
19 views

Automatically Log Out UserX when visiting WooCommerceStore

I developed a Web-Plattform, and Users Log into a DemoUser in order to Check-Out the Dashboard functionality. Now the problem is, that once they are happy with what they see and visit the ...
0
votes
0answers
19 views

Wordpress cookies for unread posts

I am trying to add "NEW" on top of my unread posts using cookies. This is my current code but the span won't show up. function wpb_lastvisit_the_title ( $title, $id ) { if ( !in_the_loop() || ...
1
vote
1answer
115 views

Login redirect_to loop with reauth=1, cookie expiry set to 1 year in past

(I've resolved this - sequencing error in wp-config.php - thanks to this answer elsewhere). I've moved a site dev to production and everything is working correctly except the login form, which is ...
0
votes
0answers
24 views

Entirely Cookieless WordPress?

It's possible to serve assets from a cookieless domain. Now is it also possible to serve everything cookieless? Of course it's not possible for admins, but for anyone who's not logged in, in theory ...
2
votes
1answer
194 views

Rest API authentication issue when called from fetch request in bundle.js

I'm able to use the Rest API for calls that don't need auth, but I'm having an auth issue for the routes that require it. Here is part of a .php view template for an admin page: <div id="...
0
votes
0answers
18 views

Password Protected Page cookie expiration time / ask for Password every page visit in a session

I found this post on my topic pass-protected pages and posts not protected after enter them 1 time But I'm not sure it got answered correctly. It must be a cookie issue, but after the first visit to ...
0
votes
0answers
138 views

Send a Cookie/Session ID in the Header wp_remote_get

I am trying to use an API endpoint that requires me to send a session ID in the header. The documentation specifies that I should send "Cookie: sessionid" in the header of a GET request. Here is my ...
0
votes
1answer
15 views

how to increase connection time

actually I'm using this script To increase the connection time // Reste connecté à WordPress durant 1 an add_filter( 'auth_cookie_expiration', 'keep_me_logged_in' ); function keep_me_logged_in( $...
0
votes
1answer
50 views

wordpress can't read a cookie?

This is a recap for my problem - after a form is submitted it will save a token (a cookie token) function set_cookie_token( $entry, $form ) { setcookie('token', 'true', time() + (86400 * 30), "/")...
0
votes
0answers
18 views

How can I set a custom cookie in WordPress?

I'm trying to set a custom cookie in WordPress. Everything I've found on the Internet tells me to use the model below in the functions.php file, which I'm doing in my child theme. Presumably the ...
0
votes
1answer
108 views

Passing cookies when using wp_remote_get

I'm working on a plugin that fetches remote RSS feeds using wp_remote_get. The problem is that Tumblr requires a cookie for GDPR compliance. This includes RSS feeds. Which means all Tumblr feeds are ...
-1
votes
2answers
24 views

How to get the id dynamically to store cookies

Right now I'm getting the id statically in my output "1778a1778" because of array_push(), but I have to send ID dynamically and get the same output.
0
votes
0answers
24 views

Extend Cookie with auth_cookie_expiration not working

I was trying to extend the Login Cookie with the following Code function expiration_filter($seconds, $user_id, $remember){ //if "remember me" is checked; if ( $remember ) { //WP ...
0
votes
0answers
51 views

How can I set cookies on my posts so that I can get view count of that post [duplicate]

Can anyone help with the solution? This is my post and I have created a custom column to get view counts on my single post. I'm want to keep a track of views for every single post. I'm trying to set a ...
0
votes
0answers
33 views

How to check if a user is logged into WordPress via perl-based download script?

I'm trying to implement code into a perl-based download script in order to check if a visitor to a download url has logged into WordPress. Otherwise do not allow the download. The direct download ...
0
votes
0answers
17 views

Can I use setcookie withiut the functions.php file?

I want to store a value if the visitor is on that page. I tried many code but the only way to create a cookie is to create a function an hook to init in the functions.php file. On this way I can not ...
0
votes
0answers
15 views

How to track and restrict external download script by logged in wp users?

My goal is to restrict direct download of external url (which has script) only to wordpress logged in users. I think we should track it by wordpress logged in user cookies. But i need a way to ...
3
votes
2answers
1k views

Why does it say: 'Cookies are blocked or not supported'?

There are many many many many pages about this issue (and I could keep going). For those who just came here for a solution, then it is: 1) Just try and refresh the page. 2) Try putting this in your ...
0
votes
1answer
20 views

Cookie cant be read even cookie is present

add_action( 'wp', 'setCookies', 10); I am using this hook to set cookies. I am using 'wp' because I need to get the current post ID. Now on my sidebar.php, I am calling if(isset($_COOKIE['...
1
vote
1answer
28 views

Auth cookie value security risk?

A short question this time: How much of a security risk is it when an third party gets access to WordPress auth cookie? Can they for example simply copy the cookie and "be" logged in as the user who ...
0
votes
0answers
14 views

cookieless subdomain err 500 and 404

I'm trying to use a subdomain for my statics data (images, js, css, themes..) I create a subdomain as CNAME : static.mywebsite.fr I added the lines in wp-config: define('COOKIE_DOMAIN', 'www....
0
votes
0answers
94 views

Easy way to check auth_cookie_expiration setting in browser dev tools?

I'm trying to change the auth_cookie_expiration setting in my functions.php file in order to limit all logins to 2 hours. I've done the basic hook for this: function expire_in_120_minutes() { ...
1
vote
1answer
69 views

How to store post ID's in cookie or session to display the same posts later

I run a wp_query that fetches 4 posts from db with rand() and displays them in a grid to visitors. What I need is to display the exact same posts the query fetched the first time, a second time to ...
0
votes
2answers
505 views

Setting Cookie with init hook causes 'header already sent'

Based on research here and elsewhere, I have the following code that sets a cookie on a site: add_action( 'init', 'my_set_cookie',1 ); function my_set_cookie() { if (! $_COOKIE['mycookie']) { ...