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
1answer
1k views

How set a cookie from PHP and get it without refresh

I know that when use setcookie() function it create headers, and after refresh it will be available in $_COOKIES, but i need a mechanism to set cookie in this page without redirect, but to be in the ...
0
votes
0answers
14 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
16 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 ...
0
votes
0answers
140 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 ...
1
vote
0answers
9 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". ...
1
vote
6answers
4k 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
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 ...
1
vote
2answers
629 views

wp_logout action not working

I'm trying to remove some cookies set to control persistent login when the user specifically wants to log out of a website. I thought it would be as simple as: function remove_user_cookie() { ...
0
votes
2answers
496 views

One time login on 2 different Wordpress sites

Im trying to figure out how to login one time to mydomain.com and being automatically loged in to mydomain.com/blog . I have figured out how to share tables (so that the same users on my main site, ...
1
vote
1answer
485 views

Current path on page in functions.php

How can I get the current path of my page? I know how to do it inside a template file, but I need it inside functions.php. And it has to be before the send_headers hook, because I'll use this info to ...
0
votes
1answer
2k views

Cookie set without HttpOnly flag

I try to add cookie information but i have no result. The tool sends me the same information. I trying to displayed the mention HttpOnly after path parameter => "Parameter : PHPSESSID=...
2
votes
1answer
1k views

Subdomain login problems

Tonight I installed a clean copy of WordPress on my local machine, with the intent of trying to set up a subdomain multisite installation. (I've got lots of experience using subdirectories, but this ...
2
votes
1answer
57 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) ...
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 ...
5
votes
1answer
70 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:...
0
votes
1answer
437 views

setcookies and header send

I put simple php condition in the header.php of template as this : setcookie("test_time_".$cookie_id."", $cookies_times, time()+3600); The result always as this headers already sent , i use this ...
4
votes
1answer
58 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 ...
3
votes
4answers
14k views

Setting custom cookies in Wordpress

I am trying to set cookies to re-route returning users to my a specific page within my Wordpress site. I'd like some advice with these 2 things: Where in the Wordpress php files should cookies be ...
0
votes
2answers
49 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
14 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
26 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
26 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
16 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
17 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 ...
6
votes
1answer
90 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 ...
3
votes
1answer
40 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 ...
1
vote
1answer
347 views

Website Loads Twice Unnecessarily

When I use tools.pingdom.com, I can see that my website is loading twice unnecessarily. The first time www.junkluggers.com is loaded, a cookie is set. Then part way through the loading process, www....
0
votes
1answer
29 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
29 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
209 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
57 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
21 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. ...
5
votes
1answer
214 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 ...
1
vote
1answer
43 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 ...
2
votes
2answers
994 views

WordPress Ajax Login without page reload

I'm currently developing a WordPress theme where I want the user to be able to upload images before he register or log in to the site. The initial problem was, you can't upload images to WordPress ...
0
votes
0answers
19 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
89 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 ...
1
vote
0answers
77 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 ...
1
vote
1answer
315 views

Visiting Webpage ONLY after another page was visited. Possible?

I am looking for a way to solve the following problem: User should only be able to visit mywebsite.com/page2/ after they visited mywebsite.com/page1/ If a user was not on page1, s/he should not be ...
0
votes
1answer
87 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
35 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
23 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
34 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 ...
2
votes
1answer
55 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
24 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 ...
0
votes
0answers
92 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 ...
1
vote
1answer
43 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
43 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 ...