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
vote
0answers
15 views

Wordpress Keeps Logging Out - What Tests Can I Run to Solve This?

I keep getting logged out of wordpress randomly. Despite having set long "Remember Me" times etc. I am still being required to log back in when I re-open my browser and whilst in admin, I randomly get ...
1
vote
1answer
63 views

Can't GET draft posts via REST API from headless frontend

I have a headless install of Wordpress on v5.4.0. The frontend can't GET any post that is in draft status, though when accessing the API url directly the data is returned without an issue. I'm ...
0
votes
0answers
25 views

How to really secure protecting single sites with an passwort? (How to not leak password in cookie?)

If you protect a Wordpress page with a password, it seems that this password is stored as a hash in the cookie wp-postpass_.... This is valid for 10 days. Even if it has expired, you can extend its ...
1
vote
0answers
11 views

User Session and Stored Cookies not get removed

I am using below code to remove the user session, cookies etc, but its not working. Please help me to resolve this issues $userid = get_current_user_id(); //get current user id sleep(30); //to ...
1
vote
0answers
41 views

How to fix samesite attribute in wordpress for chrome errors?

I have several wordpress sites that run on a rhel7 box that I admin. All of the sites use a custom SSO plugin that I wrote. Today I was told that other sites were having issues accessing one of ...
0
votes
1answer
25 views

if is_page() is not working with wp_redirect

I have a plugin installed, which is creating user profiles on frontend. The ID of this page is 301 in backend of wordpress. If a profile site is visited, i want to append the url with a parameter. The ...
0
votes
0answers
215 views

Console Messages: A cookie associated with a cross-site resource at

I gets these error on chrome console.I added this code to my header.php: <script> response.setHeader("Set-Cookie", "HttpOnly;Secure;SameSite=Strict"); </script> But it doesnt ...
0
votes
0answers
12 views

The same session information for peer users on two different WordPress servers

The MultiSite feature of WordPress is very nice. But for different WordPress installations on different servers, I need something like this. When a user logs on site (A), if the same user has a ...
0
votes
0answers
22 views

Can't get cookie free domain working for my WordPress page

I'm trying hard to get my cookie free domain working for my WordPress installation. I've followed a lot of tutorials but I still get no content over the new cookie free subdomain. These are my steps: ...
0
votes
0answers
7 views

Wordpress “logged_in” cookie not removed when logging out

I'm creating the frontend of a website in React which pulls in data from a Wordpress installation that I use as a backend via the Wordpress API, however due to some special requirements the login form ...
0
votes
0answers
32 views

Get WordPress logged in username from root domain when WP is installed in a subfolder

Here is my URL structure: http://www.example.com/homepage.php http://www.example.com/wordpress/ Wordpress is installed in a subfolder but I need to get the cookie in homepage.php to check if the ...
1
vote
0answers
22 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
38 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
25 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
44 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
26 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
9 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
19 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
28 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
31 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
30 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
37 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
140 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
34 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
24 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
18 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
22 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
1k 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
25 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
206 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
27 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
390 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
22 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
172 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
17 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
87 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
22 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
178 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
45 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
58 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 ...

1
2 3 4 5
7