Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

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.

0
votes
1answer
12 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
15 views

Avoid Cookie from removing old notifications

sorry guys 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 ...
0
votes
0answers
17 views

Set Cookie for New Post Published - Notifications bar

sorry i'm newbie with WP, I found this snippet on Stackoverflow, It working very well, but how can i get all new notifications of all new posts published, I don't need to remove the old notifications, ...
0
votes
2answers
29 views

Setting a cookie upon specific URL visit

I'm trying to set up, when a specific page/url is visited that a cookie is set and saved. So far I've tried this: add_action('init', 'set_cookie', 1); function set_cookie(){ if ( $currentURL == '...
0
votes
0answers
7 views

Expiration date is missing from auth cookies

When I login to WordPress, the auth cookies do not have expiration date, although they should be valid only for 2 / 14 days (screenshot below). The setup is a local Windows installation of Bitnami ...
0
votes
1answer
27 views

Displaying content based on drop-down menu selection sitewide

Here's the scenario: Client provides services to a wide geographical area but pricing changes based on area. I don't want to incorporate geolocation, but I do want to permit the visitor to select ...
0
votes
1answer
21 views

Wordpress cookie issue on login: “ERROR: Cookies are blocked or not supported by your browser. You must enable cookies to use WordPress.”

recently I had the problem where on login page Wordpress reported an error: ERROR: Cookies are blocked or not supported by your browser. You must enable cookies to use WordPress. This was asked ...
-1
votes
1answer
17 views

How to resolve these findings from security audit

I am working on a corporate project and they are running security audit by consultants and they found the following issues regarding Wordpress. I managed to get a lot of issues resolved using headers ...
0
votes
0answers
14 views

share cookies with subdomain

i have set couple wordpress pages as subdomain example example.com/contact is now contact.example.com but i am having issue with cookies is there any way to use same cookies in sub as well cause ...
0
votes
1answer
15 views

Use WP user status (logged_in) to manage access to independent application

I have WP installed in the root of my website. In the same directory there’s a completely independent application. What I want to do is the following: when the user accesses the page containing the ...
0
votes
1answer
47 views

Custom login method appears to ignore auth_cookie_expiration

I have a custom login form that I can display by adding [custom-login-form] to a static page. While the form does look rather different, it still submits its data via method="post" to wp_login_url() (...
0
votes
0answers
28 views

How does Woocommerce load the cookies into an AJAX request?

I'm building a plugin to allow users to use their own domain on a Woocommerce store. Everything works except for requests to ?wc-ajax=get_refreshed_fragments. On the primary domain, Woocommerce sets ...
1
vote
1answer
57 views

Trying to migrate a Wordpress Multisite with Domain Mapping

I've really gotten myself into a pickle here. So I currently have a site www.company.com which has multiple wordpress installs at company.com/site1 company.com/site2 company.com/site3 (linking ...
0
votes
1answer
45 views

How can I store user preferences in WordPress and retreive them later?

I have a WordPress website where I want to give users some options to sepcify how they want to see the site. For example, they can choose from a given set of fonts, menu color etc. I am assuming this ...
0
votes
0answers
13 views

Check if user is logged in via WP Rest API [duplicate]

I tried adding this to the response headers for the REST API to check whether or not a user is logged in: $this->send_header('is_user_logged_in', is_user_logged_in() ? true : false); It always ...
0
votes
0answers
32 views

Enable Wordpress to share cookies between domain.com and sub.domain.com

I have a Wordpress core install on domain.com and am building a JavaScript web application, without Wordpress, on sub.domain.com. I'd like to see whether or not the user has logged into domain.com, to ...
1
vote
0answers
19 views

Check if user is logged in to site A when visiting site B

I have two separate WP installs. The main site (a.com) and the blog for that site, which is on a subdomain (blog.a.com). I need to be able to check if a user visiting blog.a.com is logged in to a.com....
0
votes
0answers
13 views

Can you create a global multisite cookie that can be accessed across the network?

In a multisite install, I have a request where the client wants to store the current blog ID in a cookie and be able to read the cookie data on the main site of the network. The use cases is something ...
1
vote
2answers
55 views

Setting Cookies

I'm created two themes (light & dark) but I'm not sure how to set cookies so the theme will remain constant when the user navigates from page-to-page or comes back to the site next week. Is there ...
0
votes
0answers
17 views

New blog posts don't update on page - How to force update of cookies more frequently?

An issue I am encountering is that even after I make a new post, any user who has visited my website recently isn't able to see my updated blog posts. They only see the old posts. It is only after ...
0
votes
0answers
19 views

How to do persistent data on Front End?

I´m doing a plugin with a member system. I need to : display notices ( error, warning, info ) for visitors when they fill the form to subscribe. To match with my core project, I need a system with a ...
1
vote
2answers
84 views

Change the user is logged in cookie name

I have menu items that are set to be shown/hidden depending on if the user is logged in. I would like to change the default cookie name that WP looks for to determine login status. My cookie name is ...
0
votes
0answers
25 views

Unable to set user id in cookie

$test=wp_set_auth_cookie($user_save_flag ); echo $test; $test2=wp_set_current_user( $user_save_flag ); echo $test.$test2; $custom_page_url = 'http://localhost/wordpress-backup'; wp_redirect( $...
0
votes
0answers
22 views

Wordpress Login and Logout issue (Bitnami)

I was having problem with hostgator hosting service so I am trying to move my website to google cloud platform. I installed a wordpress website (Bitnami) and there is an issue I don't understand. ...
0
votes
0answers
32 views

block cookies from beeing set

I want to create a cookie notice where cookies should be blocked until "accept cookies" has been clicked. How can I block all cookies before?
-1
votes
3answers
891 views

ERROR: Cookies are blocked or not supported by your browser. You must enable cookies to use WordPress

when you change domain or hosting or installation folder ERROR: Cookies are blocked or not supported by your browser. You must enable cookies to use WordPress.
0
votes
1answer
17 views

is_user_logged_in() returns different values on different pages

On most of my site, is_user_logged_in() works perfectly. On two pages with similar custom templates set, this incorrectly returns FALSE. The user can navigate back to other pages where it works ...
0
votes
1answer
33 views

Login with cookie but without using WordPress code

I have been looking for a way to authenticate users without having to load up WordPress every time. To put it simply, I am generating apps that don't make use of web kits of any kind so when WordPress ...
0
votes
2answers
410 views

Wordpress delete cookie

First sorry for my bad english, i'm french. I need to make my website GDPR Friendly, so for this I use the plugin 'RGPD' who give me the possibility to check or uncheck multiples types of cookies. ...
0
votes
0answers
26 views

How to remove a cookie

First sorry for my bad english, I'm french. I have a WordPress website and I need to make it compliant for GDPR. So I need to find a way to remove cookies, I make it with google analytics but they ...
0
votes
0answers
11 views

Login session doesn't stay throughout the pages

This is really weird as I have WooCommerce (v3.4.2) in my Wordpress. I used is_user_logged_in() in a function and hooked it to wp_footer. It's just a simple function that echoes out LOGGED IN if ...
0
votes
1answer
78 views

Is there any reason only 1 (my) IP would be added to this table using $wpdn->insert?

I'm using a small custom plugin to create a table in the database and then add a user's IP address to the table if a certain cookie exists (this cookie is set elsewhere by clicking a term acceptance ...
0
votes
1answer
29 views

how to remember specific action/event for current user?

i have made multi-language site thanks to polylang now i dont want to use polylang's switcher as it causes layout issues so i found a better solution is by putting a link on top. for example if user ...
0
votes
1answer
67 views

Create simple Cookie Box for Wordpress

I have been trying to create a simple cookie box notification, and i actually would like to use this specific idea The problem is that when i run this js in my footer, and i just click the 'yes' or '...
0
votes
0answers
75 views

What Cookies wordpress use by default

Hi in my understanding wordpress is not using any cookie by default [talking about non logged in user]. But as per new GDPR law , i have to mention what cookie wordpress is creating in visitor ...
0
votes
1answer
195 views

WordPress load javascript file if something… (after the page is loaded)

I'm having an issue with making a website GDPR ready. It is loading a javascript file for InstraGram that is setting a cookie. I was able to locate where this file is loaded in the plug-in directory ...
0
votes
0answers
38 views

Controlling cookies from all plugins

Is there any way to create a cookie-consent badge that applies to all cookies from every that is plug-in installed? The EU Cookie Law plugin prevents embedded files and social media sharing buttons. ...
0
votes
0answers
100 views

Cookie for first entered page. setcookie not working for logged out users?

I want to have a function that sets a cookie on the first page a user enters. So, if the user signs up, I can save the content of the cookie in his profile, so that I know which page a user enters ...
0
votes
1answer
193 views

Do I need a Cookie consent on a basic WordPress site?

Does a basic WordPress site, which doesn't have user accounts or a login (other than admin) and doesn't sell anything, still need a cookie consent message? The site simply provides information and ...
1
vote
1answer
31 views

how can i use $_COOKIE[] + PostID to execute the below code?

someone can teach me how to combine $_COOKIE[] + PostID to count one visit by ip + post? I want use this to not use set_transient, my actual code is this: if( !current_user_can('administrator') ) { ...
0
votes
0answers
46 views

Add a cookie in wordpress functions based on page url/name

Basically I need to add a cookie and increment the value(to count how many times a page has been viewed) for each of my individual wordpress pages. Currently I have this in my functions.php file: //...
0
votes
0answers
14 views

Storing custom temporary data for anonymous users

I'm looking for some advice on the following use case scenario: I'll have this page with a form with some questions to get more information about a visitor. They won't be logged in and don't need to ...
0
votes
0answers
77 views

login to all subdomains by login in one subdomain wordpress multisite

I have installed a wordpress multisite with subdomains, it has installe d properly and working fine, Now I want to share users among the subdomains so that users are not needed to register for every ...
0
votes
0answers
361 views

Serve cookie free URLs in WordPress without using a CDN

I ran a GTmetrix test on my site (example.com) and got a very low score (50) for "coockie free domains". I gather from this error that the webpage of each URL of my domain is served with cookie ...
0
votes
1answer
582 views

Remove Cookies From Wordpress Core

I'm developing a custom theme and i understand Wordpress does come with some built-in cookies? With the new GDPR regulations coming I would like to remove these - I believe they are only there log-in ...
1
vote
1answer
59 views

How to sanitize my cookie name

guys! I'm setting a cookie after my Gravity Form is submitted. The name is based on the current page, so each page that has this form will have its own cookie. Some pages with urls ending such as /...
1
vote
1answer
38 views

Insert custom PHP head above <html> in WP pages

I've made a WordPress site. Before, I had a coded site in HTML. My new WordPress site is still in maintenance mode. But, I want to insert a PHP code above all the website content. This is my code: &...
0
votes
0answers
28 views

Dropdown set session or cookie variable

I'm using a Wordpress theme that I built with some pages where there are some dropdowns (select) to choose a State of interest, then with ajax it loads some information related to the selected State. ...
0
votes
0answers
24 views

How can I provide the user id to a javascript snippet

A client wants to add their own "feedback" tab to a WordPress site I run for them (the type that adds a floating blue tab to the edge of the page), and they need to capture the user ID when the script ...
1
vote
0answers
34 views

How I can share cookies from my dimain to subdomain?

I have one web site like hello.com, and another world.hello.com for example. world.hello.com is not a WordPress but need sharing cookie to know if user is logged in or not. How I can share in all ...