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
8 views

Conditional Content Linked to Cookie Value Only Shows on 2nd Page Load

I have the following 2 functions in functions.php // Function to set the plan cookie function set_plan_cookie() { if (isset($_GET['plan'])) { $plan_value = sanitize_text_field($_GET['plan']...
Discover's user avatar
0 votes
0 answers
19 views

Allow file access only via cookie

I need to have groups of PDF files on a site that are protected by different passwords, which I have solved with WPYog Documents plugin to create individual document repositories and Passster plugin ...
Pavel's user avatar
  • 1
1 vote
0 answers
25 views

Appropriate WP hook to use set PHP cookie

I'm trying to set cookie in init hook. add_action( 'init', 'sa_maybe_set_cookie' ); function sa_maybe_set_cookie() { if ( ! empty( get_option( 'sa_allow_cookie' ) ) { setcookie( 'sa-...
micky's user avatar
  • 113
0 votes
0 answers
22 views

Need help for deleting a WordPress Cookie with setcookie() Not Working

I'm currently working on a WordPress plugin where I've set a cookie on the front end using PHP's setcookie() function. However, I'm encountering an issue when trying to delete the cookie using ...
Subham Saurav's user avatar
0 votes
2 answers
55 views

Platform sh site setup in localhost gets Cookie error

I have setup up a WordPress project from Platform sh in my local host. I get get the project by using the platform get [id] command. I Imported the database in my localhost and configured the wp-...
tek bhatt's user avatar
0 votes
0 answers
77 views

Setcookie not setting cookies anywhere except admin

I want to set various cookies from the URL query string. I am checking for the GET values and then printing the desired values and then trying to set the value in the cookies. function on_page_load() {...
Varun's user avatar
  • 1
0 votes
0 answers
29 views

How to remove without touching the pluggable.php the wordpress_logged_in cookie to show the username on login?

cookie --> wordpress_logged_in -- admin%7C1684489617%7CTdPaXlizvGyWpJNhCrB8pUcX4725Lrte2OIOnKD3XSx%7Cfca768d6ff2014aefad62fc253b715926c8a907c05231182ba2f1c580836c2a4
Miguel Angel Salas8's user avatar
0 votes
1 answer
210 views

How do I modify each instance of setcookie?

I have an internal WordPress site that I'm trying to embed via iFrame. Currently, I'm stuck on: Error: Cookies are blocked or not supported by your browser. You must enable cookies to use WordPress. ...
Kermit's user avatar
  • 146
0 votes
0 answers
8 views

WordPress MU: Cookie error when trying to login on network WP instance

I get a Cookie error when I try to login to a WPMU site in a subdomain-based network installation. I would like to give more relevant details, but at the moment I don't have any clue where to dig. Can ...
winnewoerp's user avatar
0 votes
0 answers
45 views

How to set and retrieve cookies while in the loop

While inside the loop, I need to do some calculations with latitudes and longitudes to create a delivery fee based on a distance for each post. I have a couple hundred posts, but will only have about ...
Eric Wenger's user avatar
0 votes
0 answers
15 views

I can't log into my website , it says "Error: Cookies are blocked due to unexpected output"

I have seen others with this same problem but when I google it it resolves it in a lingo I don't understand. I need a simple answer.
Tony Morgan's user avatar
0 votes
0 answers
190 views

Wordpress Network / Multisite login to one site allow access to all

I have a wordpress installation that uses wordpress network (which I think was previously known as Wordpress Multisite). I have the following sites setup, http://www.example.com/uk http://www.example....
sico87's user avatar
  • 209
0 votes
1 answer
595 views

PHP cookie not set within AJAX call

I'm trying to set a cookie within an AJAX call after I get the response of an API. The API and AJAX call are working fine, but the cookie is not being set. I used the 'COOKIEPATH' and 'COOKIE_DOMAIN' ...
Loosie94's user avatar
  • 211
-1 votes
1 answer
307 views

Wordpress keep logged in after browser close

I want my users to be logged in even after they close the browser. I have tried below code but nothing happens, it still logging me out after closing the browser. function keep_me_logged_in_for_1_year(...
Souvik Das's user avatar
0 votes
1 answer
732 views

Why can't I enter the wordpress admin interface?

I accidentally changed the url of my wordpress page, which I finally managed to restore in phpmyadmin, the first page of my website works, but the second page doesn't, and I can't even log in to the ...
Svicc's user avatar
  • 1
0 votes
1 answer
41 views

Modify the third (context) parameter in a filter?

I understand that the following filter modifies the parameters of the authentication cookies, in fact I have managed to modify its value since it is the first parameter $cookie, but what I need is to ...
truemar's user avatar
1 vote
1 answer
92 views

Rest Api Wordpress

I wrote little plugin and I tried to use Rest Api of Wordpress for to communicate admin page to my rest. My problem is : failed rest_cookie_invalid_nonce, return 403 always. My ajax call : const ...
tecnico57's user avatar
0 votes
1 answer
262 views

Multiple issues with Ajax login function due to browsers and cookies

Using basic usage of ajax login wordpress, no cookie wordpress_logged_in_ are created on safari and Chrome and firefox doesn't read user when cookie "wordpress_logged_in". I have several ...
imagIne's user avatar
  • 41
0 votes
1 answer
174 views

Authorize subdomain to access and read user and admin cookies

My subdomains redirect alls in the main domain . I am the admin. We can access to my website by the main domain or subdomain. I use that to share cookies between domain and subdomain : There is no ...
imagIne's user avatar
  • 41
0 votes
2 answers
76 views

Cookie error. No possibility to define my cookie

I'm looking to set a cookie for one of my WordPress applications. Despite my research, I can't find why WordPress ignores the creation of the cookie. Here is my code place in my app. What do you think ...
Geo's user avatar
  • 1
1 vote
0 answers
23 views

Modifying request $_COOKIE

I have setup some conditional logic within a WP theme to display certain sections based a cookie value. I am trying now add some logic to override that cookie value in the request itself, based on a ...
mike_temby's user avatar
0 votes
1 answer
25 views

Cookies set by a plugin in wordpress for tracking

We have our companies website on a wordpress-multisite-installation with some plugins: All-in-One WP Migration All-in-One WP Migration Multisite Extension Better Search Replace HTTP2 push content ...
Zehke's user avatar
  • 1
1 vote
0 answers
79 views

How to combine wordpress_logged_in cookies in one cookie?

I'm trying to optimize my server to consume less resources as possible and increase overall performance. In my site I don't see a need to recompute same requests for users or guests every time. The ...
AtomX's user avatar
  • 109
0 votes
1 answer
179 views

setcookie on WordPress Page Template

I am having an issue with setcookie. I need to set a cookie on a page action (form). I have tried on the template file, but not working. then find out if I set it from functions.php with init hook, it'...
Sarequl Basar's user avatar
0 votes
1 answer
30 views

How can I create network with different domains?

I have heard similar questions posed but not exactly what I am looking for. Is it possible to create a multisite with different domains and sub.doamins? For example, can I create a network that allows ...
John Crockett's user avatar
1 vote
0 answers
504 views

Log in user using Wordpress REST API

I am having problems authenticating a user after logging in using a custom endpoint using the WordPress REST API. I'm aware that this is not the perfect approach but I am just trying to make a few ...
Courtney's user avatar
  • 153
1 vote
1 answer
114 views

Why wordpress cookies name contains HASH

As documented here, wordpress cookies name have HASH part. I wonder to know what is its use-case?
Mohammad Ali Akbari's user avatar
0 votes
1 answer
35 views

Favicon not loading until cookies are accepted?

I'm seeing a weird issue where my site's favicon is not loaded until I accept cookies on a cookie plugin. I wrote the plugin and as far as I know there is no tie of a favicon to cookies and the ...
Hunter Nelson's user avatar
0 votes
0 answers
68 views

How to verify which WordPress user requested the API in ASP .NET Core?

I have a use-case where I have a WordPress site and an ASP .NET Core as a Restful API backend. I use the WordPress site entire for Frontend, CMS, and User Authentication. On certain pages of my ...
user2672399's user avatar
1 vote
1 answer
83 views

Sharing a logged in session with a custom subdmain site?

I'm trying to share a Wordpress login between a typical Wordpress installation and a secondary (custom/PHP) site that will be on a subdomain of the Wordpress site. A user should be able to register on ...
Thumbs's user avatar
  • 11
0 votes
0 answers
709 views

Fatal error login Wordpress [duplicate]

When I want to login to my wordpress this appears: Fatal error: Uncaught ValueError: setcookie(): "path" option cannot contain ",", ";", " ", "\t", &...
Joshua Mart's user avatar
0 votes
0 answers
105 views

Setup cookie on Chrome even without HTTPS

I need to setup a cookie, however Chrome lately seems to accept them only through HTTPS. The "setcookie" function I use works everywhere except Chrome. If I move to HTTPS, it results as ...
a-coder's user avatar
  • 390
0 votes
0 answers
175 views

Change auth_cookie_expiration for specific roles and specific login times

In my db i have a login counter that keeps a number value as a record (1,2,3,4,5...)every time a user from a specific role logins. I am trying to change the auth_cookie_expiration to 1 day for ...
Honoluluman's user avatar
0 votes
0 answers
72 views

PHP cookie control does not work correctly

I created a custom cookie banner for my WordPress site and it works perfectly. However, now I have a small problem. With PHP I'm trying to make it invisible to users who have already accepted it. To ...
Matteo Feduzi's user avatar
0 votes
0 answers
487 views

How can I get an updated cookie in header.php?

I have trouble with getting an updated cookie. For example, I create a cookie like this in functions.php: function set_menu_id_cookie() { setcookie('menu_id', 1000, 2147483647, "/"); } ...
Roland's user avatar
  • 101
0 votes
2 answers
2k views

Setting a Custom Cookie in WordPress only for Logged In Customer/User (non-admin)

I want to create a custom cookie with custom name only for customers who have once logged in. It should be created after they successfully logged in. It should be deleted after they logged out ...
baazigar's user avatar
0 votes
1 answer
451 views

Cookie value changes back to previous value after changing

I have this custom pligin that im using in order to save the user's language preferences. I store it as a cookie like so: <?php add_filter( 'init', 'aws_set_language_cookie', 999 ); ...
user206592's user avatar
2 votes
1 answer
2k views

What is cookie "U" from domain ".adsymptotic.com" found on the WordPress page? [closed]

On a landing page of our WordPress site, I find a cookie "U" from domain ".adsymptotic.com" as the image below shows. Could you please let me know where this comes from because ...
CodeForGood's user avatar
0 votes
0 answers
918 views

When is the wp-settings-[time] cookie generated?

I created a custom plugin for login and registration forms. When I log in for a new user, 4 cookies are set : PHPSESSID, wordpress_test_cookie, wordpress_logged_in_, and 2 wordpress_sec_ . But I don't ...
imagIne's user avatar
  • 41
0 votes
1 answer
761 views

How to change WordPress cookies to be session-only

I don't want my WP site to set any persistent cookies. Session cookies while I'm logged in are all I want to allow. I don't want to have to ask visitors for consent, so I need to be sure that none are ...
Synchro's user avatar
  • 101
1 vote
2 answers
866 views

How to implement a $_SESSION alternative in Wordpress inside a theme without a plugin?

I want to show a popup to the first time visitor of a Wordpress site. I tried to check the visit state using $_SESSION. Something like this in the footer.php: <?php if(!isset($_SESSION['pxpop'])) ...
sariDon's user avatar
  • 255
1 vote
0 answers
663 views

How to save generated JWT token to cookies on login?

I'm developing a Chrome extension and I want my users to authenticate via my WP login page. I configured JWT Authentication for WP Rest API. I want the users to go to my website, login, and then have ...
amiregelz's user avatar
  • 111
1 vote
0 answers
36 views

v5.6.2 User cannot stay logged in - wordpress_test cookie placed but not auth cookies

Running WordPress v5.6.2 with a simple Members Only function checking is_user_logged_in() and running auth_redirect() - which has worked fine up to now. Pushed upgrade to 5.6.2 and now any browser ...
George's user avatar
  • 11
0 votes
1 answer
689 views

Why set cookie from URL parameter doesnt work all the time?

I use only "pages" from my WP installation (not posts) and I want to set a cookie based on the existence of a GET parameter in the URL. I have put the following code in the top of my page....
NewGuy's user avatar
  • 1
0 votes
0 answers
284 views

Authentication between two different sites using the WordPress login cookie

Two different WordPress, two different users, same account and password. In this case, if the user wants to go to (A -> B) the B site after logging in to the A site, the session HASH is already ...
Pelmi's user avatar
  • 3
0 votes
0 answers
56 views

How are sites using wordpress hiding wordpress cookies that have "wp" or "wordpress" in the cookie name?

I have looked at some big sites that are running wordpress and not one mention of it in their cookies I am trying to do that with my site...
Joey's user avatar
  • 1
0 votes
0 answers
879 views

Ajax login fails: script sets cookies, but is_user_logged_in() returns false

Summary Ajax request to a back-end plugin PHP script successfully logs in the user and sets login cookies in the browser. However, the page making the call fails to recognize those cookies, and ...
nightowl's user avatar
0 votes
0 answers
85 views

Display value of the GET parameter in a new URL page

Here's what I'd like to achieve: retrieve the GET value of its parameter from http://mysite/testing/?name=302Beep store it in a cookie redirect to http://mysite/dashboard display '302Beep' in http://...
302Beep's user avatar
2 votes
1 answer
218 views

SSO autologin Wordpress + Ajax

That one keeps me awake at night. The problem is that the user is properly logging in, but AFTER page refresh and should be immediately logged in without page reload. Need a fresh eyes to look at it. ...
WP Help Cat's user avatar
0 votes
1 answer
54 views

Is it possible to use cookie-free domains in WordPress?

Is it possible to do it manually or is there any plugin? Or I must use CDN like Kinsta? (Now we use CloudFire). Thanks for any answers!
Bogdan's user avatar
  • 141

1
2 3 4 5
8