The tag has no wiki summary.

learn more… | top users | synonyms

5
votes
3answers
598 views

why does WordPress need two cookies for auth/login

I can see two cookies: auth and login cookies in wordpress. Why do we need two? I think one is enough.
5
votes
1answer
467 views

Modifying the way WP sets cookies

I'm trying to create a custom plugin that will change the way that wordpress names its cookings. Specifically, I want to write my own version of wp_user_settings(). I know I probably shouldn't hack ...
5
votes
2answers
427 views

Passing current cookies in wp_remote_get to get Draft Post Preview

I want pass current user cookies in wp_remote_get function to get a Draft Post Preview page content. I check already the questions: What URL do you pass to wp_remote_get to load the body of the ...
4
votes
2answers
60 views

How to Create a Cookieless Domain in Wordpress

How do you create a 'cookieless' domain for WordPress?
4
votes
1answer
422 views

Disable saving comment details (name, e-mail) in cookie?

The European Union has introduced a directive requiring that websites obtain permission for setting all 'non-essential' cookies. In the UK (where my site is based), the appropriate detail is explained ...
4
votes
1answer
329 views

How to detect a user that is not logged in

Is there an easy way to see if a user - someone how has logged in in the past but is not currently logged in - is visiting my site? I was thinking that checking if $COOKIE[TEST_COOKIE] is set, but I ...
3
votes
4answers
6k views

How to validate a user from ouside wordpress/php?

I'm working on an ajax application that will be embedded in a wordpress page. The ajax app exchanges data with servlets running on tomcat. Now the servlets need a way to determine if a request comes ...
3
votes
3answers
5k views

How to set custom cookies before output

What's a surefire way to check/set cookies before the php headers are sent? Is there an action or filter that would be the best place to hook a setcookie() function?
3
votes
1answer
580 views

Using wp_set_auth_cookie for custom user account system

I've built a custom user account system using a custom post type. I was wondering whether it is safe to use the built-in function wp_set_auth_cookie($user_id, $remember, $secure) Wordpress uses for ...
3
votes
1answer
168 views

Do Cookies Need to be Sanatized Before Being Saved?

I recently wrote a plugin and now I'm backtracking a bit to sanitize any and all user input. I know that I should sanitize anything that comes from $_GET or $_POST as a user can insert malicious ...
3
votes
2answers
522 views

Place a cookie when a specific page has been viewed?

I'm trying to direct new site visitors to a custom registration page for the their first visit only. The registration collects detailed information relating to an upcoming event, it is not designed to ...
3
votes
1answer
400 views

Authentication/API Questions

We are trying to use S2Member to manage our WP site and memberships for a Flash program that we are launching. We'd like to use S2Member to authenticate the user when they login and remain logged in. ...
3
votes
1answer
246 views

Security error WP 4.0 + WP phpBB Bridge [closed]

so today I updated to 4.0 (glad I had backup). Everything was working fine until I tried to publish a post. There I got Are you sure you want to do this. Also had Cheatin' Uh under ...
3
votes
1answer
1k views

Clearing cookie on logout and session expiration

I would like to clear the session cookie when a user logs out or when their session expires. I understand that wp_clear_auth_cookie(); clears the cookie but I am struggling to understand how to ...
3
votes
2answers
204 views

WP_Http_Cookie destroys cookie value through urldecode()

Background: Working on a Widget that uses a remote API using wp_remote_post to log into the service, once logged in storing the cookies received for the second request to query data with ...
3
votes
2answers
380 views

Allow guests to save favourite pages?

We're creating a site where we want guest users to add pages to a favourites list (post IDs), so they can print or email their selection if they want. What would the best way be to do this in ...
3
votes
1answer
1k views

How to transition cookies from .subdomain.domain.com to .domain.com with minimal impact on users?

I need to extend the cookies of a subdomain.domain.com to all of the domain.com's subdomains (.domain.com in cookie terms). I am trying to minimize the impact of this transition. It seems that ...
2
votes
3answers
7k 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 ...
2
votes
1answer
2k views

Worpdress PHPSESSID / EU law

WordPress is installing a PHPSESSID cookie as soon as someone lands on my site. Under new EU law if its non-essential i have to block it so that a user can opt-in. But if it is essential its ok as ...
2
votes
1answer
116 views

Can WordPress store comment cookies on two different computers?

It's usual that WordPress stores comment author name and email in the user's browser cookies, so next time the visitor has to comment, they have their name and email already filled in automatically. ...
2
votes
1answer
208 views

How to detect that site is hosted on WPEngine?

Is there anyway to detect that WordPress is hosted on WPEngine? The reason why I need to know it in their approach to eliminate cookies. But my plugin relies on cookie and can't work without it. So I ...
2
votes
1answer
935 views

Extending auth_cookie_expiration based on user role

I'm trying to extend the lifespan of the authentication cookie, but only for administrators. My code in functions.php is: add_filter( 'auth_cookie_expiration', 'change_admin_cookie_logout' ); ...
2
votes
2answers
2k views

Wordpress Redirect based on the prescence of a cookie

I have a tricky situation.... I'd like to check for a cookie. If it doesn't exist then then redirect to an internal wordpress page, and set a cookie. And then carry on browsing the site. But i get ...
2
votes
1answer
919 views

Set cookie then immediantly refresh the page

I wrote a small WordPress plugin (mobileesp-for-wordpress) that will redirect mobile users to the mobile site. It's based on mobileesp. The plugin itself works fine the problem is I added an option ...
2
votes
3answers
564 views

Making a Custom Post type only visible to non-users via a specific link

I am working on creating a small web-app with wordpress as the framework. It allows you to input a customer and in turn sends an email to the customer with a link back to the website in order to ...
2
votes
1answer
3k views

Exclude content from w3 total cache [closed]

I use w3 total cache on a site I run which also now has to display a small popup at the bottom of the page to mention that the site uses cookies (thanks EU). The idea is that this only appears the ...
2
votes
1answer
317 views

2 wordpress blogs with 1 users table and 1 login

I have been trying to achieve that and I did without the 1 login part I fallowed this post/tutorial , but no matter what I do I can not get it to login ones for both websites. My set up is ...
2
votes
1answer
491 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 ...
2
votes
0answers
260 views

Cookie is not marked as HttpOnly [closed]

I am trying to get my wordpress driven website to be PCI compliant and the report states that we have a failure due to: "Cookie is not marked as HttpOnly: 'wordpress_test_cookie=WP+Cookie+c heck; ...
1
vote
2answers
392 views

ERROR: Cookies are blocked or not supported by your browser

I'm getting this error while trying to log in: ERROR: Cookies are blocked or not supported by your browser. You must enable cookies to use WordPress. Yet I have cookies enabled and not ...
1
vote
1answer
331 views

Get wordpress stored cookies for custom login

I've created a custom login box. I'm using wp_signon() method. Everything works well. Also i have a Remember me checkbox so i can remember user credentials next time. I know i can do it my own way of ...
1
vote
1answer
549 views

Show greetings on first time visitors?

This seems pretty straightforward using cookies in straight HTML. In wordpress, how do I do this? AFAIK, wordpress only provides cookies functions for logging/logged in users. How about when I don't ...
1
vote
1answer
86 views

Searching hook to set cookies before <head> and avoid “headers already sent”

I have written a plugin that sets cookies, and need to avoid the "Headers already sent" PHP error by placing the code at the very top before the head section. Themes usually place wp_head just before ...
1
vote
1answer
205 views

Setcookie works on admin but not front end

I have a simple function to set a cookie to the value of whatever parameter is attached. For example, if I visit http://example.com/?devsource=http://dev.example.com/ it should set the value of the ...
1
vote
1answer
407 views

Cookie value cannot be read until I've logged into the WP admin

Once logged into the WP admin, I can refresh the front-end and see my cookie's value outputted as "hello world". If I log out of the admin, then refresh my front-end, the cookie's value is now ...
1
vote
1answer
2k views

Set a cookie in WordPress, using a select form and Jquery

Hi Guys and thank you in advance for giving me some attention with this. I have this code in wordpress that I just can't get right. I have the US states in a drop-down form. When the user chooses an ...
1
vote
1answer
99 views

Change in permalink structure made javascript cookie not work correctly

My site needs a mechanism where a user is sent to agreement page when he visits the site for the first time. Once he accepts the agreement, it is saved in cookie. He can browse any page directly after ...
1
vote
3answers
368 views

Prevent installation of style.css cookies and file caching

I'm having a problem which I have never encountered before. When I update my style.css file within my child theme, the webpage does not use the new style. I have pinpointed that to a cookie within ...
1
vote
1answer
1k views

Logout user and delete cookies from the client side?

I'd like to be able to logout the user. I can do this by calling wp_logout() on the server but if the user drops connection is there a way to log them out? The wp_logout() method clears the cookies. ...
1
vote
2answers
675 views

How to setcookie if is_page('page') ? should I use add_action('init') or there is another action?

I want to setcookie if is_page('arabic') or is_page('english') then redirect to home_url() only if the page name/slug arabic or english, I think that init action happen before the code determine the ...
1
vote
1answer
3k views

How to get login data (session) outside WordPress?

I guess WP uses a PHP session (or a cookie) to save login data, right? I have a website, which uses WP as a CMS, but display (and create) content from outside. I allow anonymous posts, by simply not ...
1
vote
1answer
653 views

Set authentication cookies to be shorter but then extend with every page load

I'm trying to get around the otherwise very insecure way of Wordpress handling authentication cookies. I mean, having the cookie expire in 2 weeks only if I build a membership site is obviously not ...
1
vote
3answers
828 views

Setting a redirect cookie in wordpress

I've been searching on the net for a solution to my problem all day, but I can't make sense of anything I see, since I know absolutely NOTHING about coding. What I'd like to do: I'd like to set a ...
1
vote
2answers
210 views

background/font size change and remember

I want to create font size and background change buttons, which i know how to do it. The problem is with remember it, so if user will go to a different page, background and font will stay the same. ...
1
vote
1answer
383 views

Serving Cookies From A Different Domain or Sub-Domain

The WordPress Codex clearly states that if your website is served from example.com, for the sake of performance, you can have the cookies served from www.example.com by adding this to your ...
1
vote
1answer
240 views

Why is my cookie not unsetting upon logout? [closed]

if (is_user_logged_in()){ if(!isset($_COOKIE['alertuser'])){ // set cookie $timer = time()+86400; setcookie('alertuser', '1' $timer); // show alert ...
1
vote
1answer
217 views

Wordpress cookies

I am trying to set a cookie on click via setcookie('mycookie', 1, time()+60*60*24; but I can not seem to get it working . If i click the button - when I check my cookies, it is not there .
1
vote
2answers
155 views

How does Wordpress remember which editor is being used?

Hey so I am trying to determine how Wordpress remembers which editor is being used for a particular post (HTML or Visual Editor (tinyMCE)). When you write a post, and then come back, it goes to the ...
1
vote
1answer
110 views

Author Tracking Code!

I need help with coding this piece. Basically i want with someone click on my author page. It stored a cookie of that author name and email. I want the cookie to stay in place untill the person close ...
1
vote
1answer
106 views

Can't log in: “ERROR: Cookies are blocked or not supported by your browser. You must enable cookies to use WordPress.”

After a server move, I'm unable to log in to my site. I get the "ERROR: Cookies are blocked or not supported by your browser. You must enable cookies to use WordPress." error when I try submitting the ...