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

Rating from a mobile app

I am looking for a way to allow my users to submit post ratings from my native mobile app. I have found this plugin : https://github.com/lesterchan/wp-postratings The calls are made by ajax to : ...
0
votes
0answers
16 views

How can I set cookies on both secure and non-secure origins at the same time?

I have a front-end login process via admin-ajax.php. It's a standard user/pass form so I submit the POST request to a secure, https, endpoint regardless of whether the user is currently on a secure ...
-1
votes
1answer
27 views

Hook when a cookie LOGGED_IN is set

I need to fire a function when a user is logged in and the cookie logged is set. I've tried with the action hook "wp_login", but won't work because i need the cookie LOGGED_IN. i've tried with the ...
0
votes
1answer
22 views

Detect if authentication is set to “remember” a user being logged on

I am writing a custom frontend logon page for a theme I am working on. The logon page uses wordpress functions as much as possible (eg., wp_signon, wp_set_auth_cookie, ...etc.). For logging on, I do ...
0
votes
1answer
13 views

Showing different pages depending on a cookie value

I have a website that asks the visitors to choose a language on the first page, I store the option in a cookie and I am showing the content (starting with second page) depending on this option. I ...
0
votes
1answer
15 views

Set cookie with taxonomy name

I know that a should set a cookie before any output. I want to set a cookie with the actual page's taxonomy name. To get the taxonomy name I am using get_query_var('taxonomy). The problem is: If ...
0
votes
0answers
18 views

Can I pass external cookies to a WordPress Site which has no auth

I have my company website which has authentication which is non WP and the documentation pages are made in WordPress I need to pass cookies to WordPress Pages where they can show the content based on ...
3
votes
1answer
32 views

Keep Users Logged In As Long As I Like

I'm implementing a Kiosk webapp based off WordPress and I have some conditionals which are key, they work based on whether user is logged in or not. I'm aware that after user clicks "remember me" it ...
0
votes
1answer
24 views

Where is function to prevents non logged users access wp-admin?

Where is the function, that prevents non logged users, access restricted pages in Wordpress? I've looked in several files, but not found. I want to modify the way Wordpress authenticates to check ...
0
votes
1answer
23 views

How to read third party cookie to access password protected pages

does anyone know a quick and simple way to also give access to a WordPress standard password-protected page if there is an existing third party cookie on the user's machine? I need to see if someone ...
0
votes
1answer
90 views

Referrer URL with jQuery or Javascript - Cache & Referrer URL Issue

Hope someone can help me : ) What Im trying to do is, get the first visit referrer and send it to form. We user Contact form 7 plugin, so I created a hidden input, get the referrer URL and assign ...
0
votes
0answers
43 views

setcookie() using $_GET variables in plugin

I'm trying to store a few analytics tags inside a session cookie to be used in subsequent pageviews. Essentially what I'd like to do is this; if ($_GET['utm_source'] != "") { ...
0
votes
0answers
13 views

How to set unlimited expiration time for wp_generate_auth_cookie()

I am writing a authentication plugin, for this I have to set cookie that never expires. $cookie = wp_generate_auth_cookie($user->ID, $expiration, 'logged_in'); $cookie value should never expire. ...
1
vote
1answer
24 views

Why a strange discrepency between get_current_user_id() when using AJAX versus output of document.cookie?

I'm developing a simple Ajax function as part of a plugin intended to be used from within the traditional WP Admin dashboard but am encountering a discrepancy regarding the login cookie state. The ...
5
votes
1answer
204 views

Security in WordPress plugin development

My plugin is Mailer.app for WordPress, I'm 85% completed and I'm focusing on security before release. Before the questions, I should outline the plugins architecture: The plugin is able to take in ...
0
votes
0answers
18 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
51 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
107 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
49 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
59 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
32 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
776 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
22 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
28 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
78 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
3k 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
21 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
42 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
27 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
35 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
82 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
27 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
18 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
29 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
101 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
75 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
54 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
107 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
167 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
76 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
142 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
63 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
164 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
21 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
154 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
212 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
54 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
97 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
16 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
192 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 ...