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

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
240 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 ...
2
votes
1answer
58 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) ...
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 ...
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 ...
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....
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 ...
3
votes
0answers
231 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 ...
3
votes
0answers
441 views

How to share WordPress session and cookies between domain and subdomain?

I have missed a lot of time by searching answer to my question. For today I have two WP installations on the one server and one DB but with different prefix. I already shared users data and meta ...
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
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
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
0answers
249 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, ...
1
vote
0answers
187 views

Login problems on multisite installation with different domains

I have a subdomain multisite installation in site.com, with subsites such as sub1.site.com, sub2.site.com etc. I needed to transfer one of these sites to an own domain, sub1.com. So I changed the ...
1
vote
0answers
549 views

How to handle cookies from a WordPress plugin on a cached page?

I'm attempting to write a plugin that can work with cookies on a WordPress site that uses page caching (why?). I've been following this tutorial on Esanctuary.net. I'm trying to write to the ...
1
vote
0answers
75 views

WP not logging in at first time

I've been experiencing a weird "bug" in my website which I have a form in the front page to do the log in, it doesn't log, redirects me to the WP-login.php and it says the Cookies may not be active in ...
1
vote
0answers
180 views

Login cookies set as wrong domain

I'm building a plugin that allows oauth2 logins from providers (eg google). My code is setting the wordpress_logged_in_{$hash} cookie domain as /wp-admin, for some reason, whereas using the normal ...
0
votes
0answers
15 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
17 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
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 ...
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
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 ...
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. ...
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])) { // ...
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 ...
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
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 ...
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 ...
0
votes
0answers
22 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
0answers
87 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/...
0
votes
0answers
264 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 ...
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 ...
0
votes
0answers
236 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', 'http://www....
0
votes
0answers
321 views

is_user_logged_in() not working after domain change

I am relatively new to Wordpress and I recently moved a WordPress website from one domain to another. I went through and fixed all the links and references that I could find. Now my website has all of ...
0
votes
0answers
2k views

setcookie not working when defined with '/' but working if not defined

I have a very strange problem. I have this code in my functions.php. I followed the instructions and placed this code in the functions.php that was available in my theme folder in wp-content/themes/u-...
0
votes
0answers
532 views

Why WordPress not logout after I have close my browser?

The default login cookie has expiry time as "session", so suppose when I close my browser, I need to login again when I visit wp-admin. But I've found that serveral time I've closed my browser (kill ...
0
votes
0answers
454 views

wordpress_logged_in cookie not being recognized in htaccess

On my website, I have a system implemented that requires users to login before viewing any files in the wp-contents/uploads folder, specifically pdf's and doc files only. In order to do this, I have ...
0
votes
0answers
185 views

setcookie in functions.php does not accept arguments (variables) passed from WordPress page

I have a WordPress installation where a page (Page 1) displays certain fields from a selected user's profile (Not the logged in user but a user they have selected). A PayPal button is used to take a ...
0
votes
0answers
499 views

How to use Cookie or Session php for one page and just a password

I'm looking for to use a cookie with wordpress 4.0 and it doesn't work.( OVH) I have read that Session or Cookie are deactivate by default inside the load.php folder. Somebody could tell me how to ...
0
votes
0answers
214 views

!is_user_logged_in() fails

Updating to Wordpress 4 has broken this for me, and I'd like to understand how to fix it. The following code should redirect users when they are not logged in : <?php if ( !is_user_logged_in() ) {...
0
votes
0answers
63 views

setCookie before headers are sent?

I was using this code in my plugin to set a cookie if a condition was met, however after updating to Wordpress 4.0 I got the message: Warning: Cannot modify header information - headers already sent ...
0
votes
0answers
76 views

Load post conditionally

I am working on a website which displays only 3 posts unless people subscribe for a newsletter. This is done by setting a cookie on validation and inserting this cookie conditionally in my queries. ...
0
votes
0answers
45 views

My website resets when accessing the index page

So my wordpress theme and website is on a stage server, since it's under production. And this issue happens once in a while. Basically, if I log in as a user, and when I enter the index page, the ...
0
votes
0answers
1k views

Wordpress Cookies - wp_set_auth_cookie

I would like to make the login working to all of my wordpress sites. They are single installs, so no multisite plugins can help. I decided to go with the cookies. I store the users in the same ...
0
votes
0answers
266 views

Cookie in custom page template

I need to set a cookie on a custom template (page_splash) so that the splash page only shows on the first visit every 24 hours. I have tried lots of variations of code at the top of my custom template ...
0
votes
0answers
176 views

Create and update Custom Cookie based on multiple GET and POST Values for first time visitors?

I am not exactly sure the most efficient way to write this code. I collect custom data in my forms and also in my url via get such as: Name utm_campaign URL Referrer ID Among many more. Do I ...
0
votes
0answers
88 views

Accept (once only) policy page on login

I'm developing a simple application on WP that requires the user to accept a policy page on first login. If they accept, they're redirected somewhere (homepage), if not, they're redirected somewhere ...
0
votes
0answers
1k views

WP Logs me out after updating anything on dashboard

Not sure what is going on here but my live site kicks the admin out every time they change something in the dasboard. For instance when an admin updates a page the url looks like http://mysite.com//wp-...