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

1
vote
0answers
9 views

Is it safe to save a cookie in my mobile app internal memory and use it for further authentications?

I am planning to generate an authentication cookie with the JSON API and save it in my app memory with : https://example.com/api/user/generate_auth_cookie/?nonce=+4d080ff7b8&email=user@gmail.com&...
0
votes
0answers
9 views

Setting cookies in WordPress error

I'm having issues attempting to set a cookie containing a URL or ID. The background behind this that I have a WP site developed where the home page contains a list of locations (which is a custom ...
0
votes
0answers
19 views

wp_signon not working on website but it works on localhost

wp_signon() is not working on my online website, though it works on localhost. I am making a custom login for my website, and can't understand how to solve this problem. When I log in on localhost (...
0
votes
0answers
25 views

How to set cookies and use it for redirection?

On WordPress, I have a page in which I call an iframe to display an other page (which is on another website). This other page is depending on the days past. The first day, I want to display page1 ...
1
vote
0answers
13 views

Redefine cookie domain for subdomains

I have done all the research on this question but none of it is working. I have an application consisting of a Wordpress site at "domain.com", and a CakePHP/Angular application at "sub.domain.com". ...
0
votes
0answers
11 views

What is the best option to change menus automatically using cookies in a Multisite installation?

I am developing a Portal using the Wordpress Multisite option. I would like to create a portal's homepage with options that direct the user to his country's website (Subdirectory). And i would like ...
5
votes
1answer
81 views

How to mark articles as read?

I have a normal Link: <a href="/article-1"><span class="visited-circle"></span>article 1</a> and when someone have visited this article so i changed the color in CSS: a:...
2
votes
1answer
64 views

How to resolve error “Cookies are blocked due to unexpected output.”?

I am facing an error as per below at admin panel login. "ERROR: Cookies are blocked due to unexpected output." I've tried several solutions like, Log checking (No logs are showing in log file) ...
4
votes
1answer
79 views

Check if user already visited this post today

I have a piece of code which measures a post popularity. How would I go about checking if user didn't already visited this post for past 24 hours? Do I need to set a cookie for user and for each post ...
0
votes
1answer
24 views

How to store a number (coming from cookie) into query vars for later usage in other filters?

I have a small HTML5 game playable (as "canvas") at different social networks, which sets an HTTP cookie. When a player comes to my Wordpress site (acting as help and support website for the game), I ...
0
votes
2answers
68 views

Deleting cookie to logout

Would be potential problems if I delete wordpress_logged_in_47d1523b... cookie using javascript? Is there something additional that wp_logout does?
0
votes
0answers
16 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
35 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 ...
0
votes
1answer
30 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
17 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
19 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
22 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
44 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
31 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
34 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
285 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
65 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'] != "") { setcookie("...
0
votes
0answers
26 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
52 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
219 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
20 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
108 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
152 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. I can login and the ...
0
votes
1answer
99 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
36 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
1k 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
24 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
41 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
97 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 ...
2
votes
6answers
5k 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
26 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
46 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
52 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
44 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
92 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
37 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
25 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
31 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
171 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
98 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 wp-includes/...
2
votes
1answer
56 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
119 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 subdomains,...
0
votes
1answer
335 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
81 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
193 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 add_action('...