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.

learn more… | top users | synonyms

0
votes
0answers
12 views

How to check if this cookie set by this page?

I use this code to check if special cookie set on user browser. Now i want to check if this cookie set by this page. How can i do it? if (isset($_COOKIE['comment_author_email_'.COOKIEHASH])) { // ...
1
vote
1answer
34 views

COOKIE_DOMAIN setting confusion

I'm upgrading my website and it's using WordPress. I'm using sub-domain cdn for CDN and it needs to be cookieless. Currently my website is a multi-network of multisites (both are subdirectory ...
0
votes
0answers
59 views

Logged In cookie gets saved but not Auth cookie

I am trying to get WordPress to run on PHP-CGI which I call from my ExpressJS (Node JS) server. After getting some bugs worked out on my end, I finally got the front-end working and I can login and ...
0
votes
0answers
24 views

Cookies not working

I have a development server on DigitalOcean and my client's Rackspace production server. I did a migration of their WooCommerce site from one server to the other. On the development server, cookies ...
0
votes
1answer
31 views

Best method to show modal only once

I would like to display a modal-window to first time visitors of my site. After that it should not be visible anymore for that visitor. What is the best method to go about this? Normally I could use ...
0
votes
1answer
24 views

How to make a cookie be on the whole site instead of being on a specific page/

So I had an idea to make a button that swaps between css files in order to do random stuff such as making 2 backgrounds that the site users will be able to swap between. I had no idea how to do it, ...
0
votes
1answer
215 views

Woocommerce Ajax Add cart not working

In woocommerce ajax add to cart method not adding when cart is empty, if cart contains something then my ajax function adds but if cart is empty it doesn't add. And no error. Here is the link. PHP ...
0
votes
0answers
18 views

display menu depending on selection on homepage

Like I wrote in the topic On my homepage there are two links: business and consumer depending which link I choose I want to display a certain get_template_part (menu) So If you click on "business" ...
0
votes
1answer
17 views

Use cookies in pagination

I am having a problem with cookies. I am using page breakers for long content post. I initialize a cookie with value 1 once you are reading the post. For each page breaker or let say page (from ...
0
votes
0answers
55 views

Cookies are blocked or not supported by your browser [Login Issue]

I have been searching and found there are a few questions related to this title. But, my case is slightly different. Because, i have created the frontend login page on my site. When i first log in ...
0
votes
6answers
1k views

Login page ERROR: Cookies are blocked due to unexpected output

I have a WordPress website that I recently discovered had this error on the login page: ERROR: Cookies are blocked due to unexpected output. For help, please see this documentation or try the ...
0
votes
1answer
15 views

Manipulating cookie on specific taxonomy archive page

I have this code to set cookie when user on the taxonomy archive page called 'term-country' if (is_tax('term-country')) add_action('init', 'my_setcookie'); // my_setcookie() set the cookie on the ...
1
vote
1answer
37 views

Disconnect automattically after X minutes

I recently discovered that if I don't disconnect myself from WordPress, my session could last for more than a day. I wondered what could I do to set a maximum time of inactivity on the site, after ...
0
votes
0answers
17 views

Is it possible to login in with a token rather than login credentials?

I'm working on an application that connects to a WordPress blog. Right now, the user logins in through the app. But there are times when they need to login to the website. I would like to make it easy ...
0
votes
1answer
30 views

What are your thoughts on overriding the PHP builtin setcookie() function to control whether or not WP creates cookies

This is a long post: This is regarding the UK, UE, and Italian cookie laws. Even though My sites are hosting in the USA I reside in the USA My sites are not commercial sites None of my sites, ...
5
votes
1answer
71 views

Remember the last post I read

I am currently publishing a book series with WP (not in english). Books, chapters and subparts are arranged this way: Each book (category) is divided into chapters (subcategory) which is divided into ...
0
votes
1answer
16 views

set cookies or let system know a user has been on site

I would like to set a button on my site that links to a registration page (this registration is off site by a company called wufoo so it will not be registering on the wordpress site) if a visitor has ...
0
votes
0answers
14 views

Store id from database query in cookie

I need to store an ID value which is generated upon doing a database insert. After the insert, javascript redirects the user to an external page, which will then redirect back to a wordpress page ...
0
votes
1answer
25 views

Store value in cookie

I'm doing a database query in a page, and afterwards I want to store an id - I thought I could do it in $_COOKIE? But it doesn't seem to work to just create a parameter and set a value to it, like: ...
0
votes
1answer
64 views

How can I set up a splash page that is redirected to only one time for the visitor? [closed]

I would like every new visitor to be redirected to a splash page upon their first visit. They need to enter their email/submit in order to get into the site. This isn't the standard login type of ...
0
votes
0answers
55 views

set cookie before log out and after admin login

Hi I am new to wordpress. I had researched lot about this but didn't succeed. I want to set cookie value NULL before logout and custom value after admin logged in. So I put below code in ...
2
votes
1answer
47 views

Logins through alias

My site is hosted by a university that runs all external traffic through an alias. The actual URL of the server is accessible only on campus. Right now I have the site address set to the alias and the ...
0
votes
1answer
95 views

Cookie settings for session across WPML subdomains using custom AJAX login

I am trying to enable a custom login session across both English and French subdomains. -WordPress is installed only on domain.com. -There are only en.domain.com and fr.domain.com as WPML ...
0
votes
1answer
102 views

How to change cookie name

Im trying to figure out how can I change names to cookies that wordpress is setting for example on login. wordpress_test_cookie = sitename_test_cookie or/ and wordpress_logged_in = ...
1
vote
1answer
66 views

Do We Need to Validate, Sanitize, or Filter Simple Numerical Superglobals (Cookies and Post)?

I'm writing a plug-in that stores UNIX datetimes in browser cookies and that also uses a $_POST variable based on a simple form that sends the ID number of the current WordPress post. After reading ...
0
votes
1answer
112 views

add_action in a custom plugin

I did a plugin to create a when the cookie is FALSE. Actually, the was working, but when I was about to create the cookie, it said that my header was already sent. Then, I had the code ...
1
vote
1answer
46 views

How to delete Passwrd Protected posts cookies when a user logged out from the site

I wanted to delete all the cookies set for password protected posts when user logged out from the site after going through those Password protected posts. Is there any function to do this?
4
votes
1answer
148 views

Keep one user logged for a year?

This has got to be simple: how do I keep one user - my-user - logged in for a year? (I'm checking logged in cookies in the dev tools console). Update 8/16/15 This works: add_filter( ...
1
vote
0answers
20 views

Session Expired when WordPress Address (URL) and Site Address (URL) are different

I followed this article to allow me to put our company's WordPress blog on a subdirectory of our Heroku hosted site: http://nicolasmlv.com/wordpress-in-your-rails-app/ This says to add this code to ...
1
vote
1answer
122 views

How to switch css files according to devices and button click?

I am trying to enqueue a responsive css file if the website is opened on mobile devices. Also I want to switch / enqueue a default or non-responsive css file when a button is clicked. The ...
3
votes
1answer
168 views

Display message once per session to users with a specific role

I need to display a message to only users with a specific role. The message should appear either as soon as the user logs in or if they re-open their browser after having closed it when logged in to ...
0
votes
1answer
46 views

Use WP_Query Data In Cookie

I've collected an array and set-up a cookie via functions.php, both work fine. However, I really need to post the data to the function and set the cookie as this information will vary per customer. ...
0
votes
1answer
67 views

Using Cookie Data For WP_Query Loop

I'm trying to retrieve data set in a cookie and use this to run a query. I've set the cookie in functions.php like so; add_action( 'init', 'resultsCookie' ); function resultsCookie() { ...
0
votes
1answer
15 views

Opening protected page with cookie?

I'm working on an app that uses WordPress for user management. After login, the app holds the auth cookie. How can I use that cookie to open a web view of a protected page within the app without ...
1
vote
2answers
163 views

can we share user login in 2 wordpress installs in 2 subdomains on one server?

We have 2 WordPress sites in 2 different sub-domains like test1.abc.com and test2.abc.com . Both sites have wp-require plugin activated and only logged-in users can see the site. We want to make a ...
2
votes
1answer
88 views

Setting cookies in Wordpress

I am trying to set a cookie on my site and wanna switch the style sheets using this cookie. I've tested a normal function but it does not work. I've put below code into my functions.php ...
1
vote
1answer
84 views

How to set cookies to switch style sheets when a link is clicked and set it till another particular link is clicked?

I have a very old site. Now I want to make it responsive without changing the theme an it's style sheet. Requirements: Can not change the theme. Can not create child theme. By default, the site ...
0
votes
0answers
223 views

Setting a cookie in functions.php and it gets deleted when working on an other function

My first function gets the parameters from the URL and sets the cookies: /** Get variables from the URL and set them into the coockie **/ add_action( 'init', 'set_utm_cookie'); function ...
1
vote
0answers
24 views

What is the purpose of having a token in cookies?

WordPress utilizes cookies for better security, and I've been trying to understand how exactly this could make a WordPress website more secure, and I found this article . There's a pretty decent ...
0
votes
0answers
68 views

Check for cookie (from another site), then do redirect if detected, do nothing if not detected

I've been working on this for a few days. Tried implementing solution via functions.php but I keep coming up with the problem of infinite loop because naturally the redirect (if cookie is detected) is ...
1
vote
0answers
195 views

How does the “authentication unique keys and salts” feature work?

I'm trying to find some information on how the authentication keys and salts work in WordPress, but unfortunately I wasn't able to find anything useful. All I got is that the keys should be random, ...
0
votes
0answers
259 views

Cookiechoices.js keeps reappearing without caching plugin

If you visit my site, there's a notification about cookies that you can click away and then it shouldn't reappear (maybe until you empty your browser cache). It used to work. I got the javascript ...
0
votes
0answers
33 views

Public page exposing wordpress cookies policy

I'm not interested in installing a plugin to show a popup that inform user with message: 'This website use cookie...'. In order to respect italian cookie law i should expose a link for each third ...
2
votes
2answers
221 views

Get user ID after logging in

I've been asked to add a sort of safety mechanism to a site where a user can only access their profile if they have a cookie set after logging in, and they can only have a maximum of 3 cookies. I've ...
0
votes
0answers
211 views

Set cookies based on visitor choose (first time visit site)

i am working on solution to set cookies based on visitor choose. when the visitor first time visit my site, popup uppers with "select branch". so when the visitor select the branch i make the ...
2
votes
1answer
160 views

jQuery cookie not working properly in wordpress

I make my own accordion menu with html + jquery its working perfectly to forth level, then i add a cookie code from net and do some extra work it also work 100% perfectly in html. My complete HTML + ...
0
votes
0answers
157 views

Cookie Domain is preventing Admin login

I just defined a Cookie Domain in my wp-config.php: define( 'COOKIE_DOMAIN', 'http://www.example.com' ); define( 'WP_HOME', 'http://www.example.com' ); define( 'WP_SITEURL', ...
0
votes
0answers
326 views

How can I set and use a cookie on page load?

So I can set a cookie using the below code, and use the cookie I have created when the page gets refreshed problem is I need to set the cookie and use the cookie when the user first loads the sites. ...
2
votes
0answers
181 views

wp_set_auth_cookie() doesn't work in Ajax call

I am trying to create a Facebook JS-SDK based auto login feature. When user is "Connected" passing FbID and aother user data to an ajax function which creates the session cookie. Cookie is created (I ...
6
votes
1answer
458 views

Removing username from the 'wordpress_logged_in' cookie

I am working with a client with some strict security measures. After undergoing security review, we were notified that the user name stored in the logged in cookie, e.g. ...