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
0answers
10 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 ...
-1
votes
0answers
16 views

Are the “_uc” cookies used with Google's utm URL parameters?

I'm trying to figure out what some cookies on my Wordpress site are. There are five cookies that all start with "_uc". I've googled around to try to figure out why specifically these cookies are ...
0
votes
0answers
19 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
12 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
9 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
20 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
18 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
12 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
17 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
24 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
42 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
17 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
13 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
71 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
16 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
12 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
59 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
17 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
53 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
12 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
93 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
14 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
20 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
16 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
54 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
18 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
45 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
29 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
600 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
13 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
73 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() { ...
0
votes
0answers
7 views

can i set cookie by assign?

Mistakenly i created a cookie by assigning it to value e.g. $_COOKIE['limit_reached'] = 'reached' then i tested my code that depends on it and it worked, then i figured out that this isn't how we set ...
1
vote
1answer
56 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
334 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']) { ...
0
votes
1answer
365 views

Getting an ERROR: Cookies are blocked error when logging in to a site on a different domain?

I am getting the following error: ERROR: Cookies are blocked or not supported by your browser. You must enable cookies to use WordPress. When trying to login to a network site on a different ...
1
vote
0answers
45 views

Cookie signed verification failed - wp-saving-post

I'm setting a WordPress, but posts can't be saved. A 500 error shows up. I contacted the system's team, and apparently it's because they have a Firewall (Fortiweb), and one of the rules is about ...
0
votes
0answers
269 views

Calling wp-login.php?action=postpass not setting cookie

I'm trying to set the wp-postpass cookie via my front end homepage written with vuejs. Relevant code below: submitForm() { console.log(this.password) axios .post('https://mywebsite.com/wp-...
0
votes
0answers
23 views

How can i get counter of all new post published using cookie

I'm trying to make it work, I found this snippet here on stackoverflow, and it working very well, I did some changes to build an drop down notifications box with bell icon as shown in the picture ...
0
votes
0answers
276 views

How are cookie values encoded?

Title kind of says it all. I can easily generate the md5 hash for the key, but I noticed in my devtools that the value is also encoded somehow. I tried setting it to the plain-text value, but this isn'...
0
votes
1answer
141 views

Cookie only detected when visitor is logged in

This is my first time playing around with cookies, so i apologize if the question is "stupid", but i did not manage to find an answer anywhere else on this site. Iv'e set a cookie using this code in ...
0
votes
1answer
30 views

What could cause a staging environment to not send wordpress_logged_in cookies?

We have a custom login and account creation plugin. It works fine on our live environment (example.com) but not on our staging environment (test.example.com). When we call wp_insert_user via an AJAX ...
0
votes
0answers
19 views

Avoid Cookie from removing old notifications

sorry peoples I'm newbie with WP, How can I avoid cookie from deleted old notifications! How can I keep all of them until expiry comes or click on hide button. I don't need to remove the old ...