The tag has no wiki summary.

learn more… | top users | synonyms

5
votes
3answers
476 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
2answers
311 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
1answer
396 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 ...
4
votes
1answer
332 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
307 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
1answer
330 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
65 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
1answer
361 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
2answers
163 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
307 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
4k 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?
2
votes
1answer
102 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
753 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
494 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
2k views

Exclude content from w3 total cache

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
260 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
68 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 ...
1
vote
2answers
4k 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 ...
1
vote
1answer
99 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
133 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 ...
1
vote
1answer
475 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
66 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
288 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
149 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
281 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
404 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' ); ...
1
vote
1answer
424 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
2answers
191 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
200 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
197 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
174 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
1answer
108 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
0answers
37 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
78 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
56 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 ...
1
vote
0answers
108 views

Contact Form 7 - Show additional post content when a user enters their information

Is it possible to show a brief snippet of a post until someone submits a form using contact form 7, at which time a more detailed post is displayed automatically? Is it also possible to store a ...
0
votes
1answer
82 views

Accept or deny cookies - how to?

As far as cookies privacy policy has been change, i need to make a script which allow to accept (or not) cookies by user for this domain (website) only. Is there a way to do this for one website only. ...
0
votes
1answer
115 views

Set a cookie only in single posts

I'm trying to set a cookie when a user is on a single post. I'm keeping track of how many single posts he has read this month. I have two problems: I have a custom template and added the following ...
0
votes
1answer
132 views

Using a nonce in a Custom Login Form

I am trying to create my own login form for WordPress using wp-login.php as a template. In the form that is used to collect login information from the user (lines 680 through 703 of wp-login.php), ...
0
votes
1answer
559 views

Issues with set cookie

At first I had my setcookie() as: $school = "Some Value"; setcookie("default_school", $school, time()+3600); var_dump($_COOKIE); That didn't work, so I did some searching, and found that I probably ...
0
votes
2answers
207 views

How to Collect Keyword and Search Engine Data on Webforms?

We have a contact form using Contact Form 7 on our wordpress site. We would like to be able to attach any information about where the user came from: keyword search is the #1 item of interest. We ...
0
votes
1answer
190 views

Trying to set a cookie based on $_POST parameter

I'm doing a bit of language detection that first checks the $_SERVER['HTTP_ACCEPT_LANGUAGE']. If the user wants to override the choice of language, there's a select list, where they can choose ...
0
votes
2answers
527 views

Having trouble setting / modifying cookies

I'm working on the admin interface for a plugin I'm developing, and it involves collapsible layouts. I want the state of the layout to be remembered when the page is refreshed, so I'm trying to use ...
0
votes
1answer
170 views

How to set custom cookies in Wordpress after a form is filled on a page

I have built a custom template for page in Wordpress: page-xyz.php This page has a some content. I want to check cookie. What I want to do is: If cookie is set: //show page content else //don't ...
0
votes
2answers
440 views

Detecting $_GET parameters from any page + Cookie

I'm trying to create a basic affiliation system plugin that for now, will do the following: If it exists, read a $_GET URL parameter in any page (for instance http://mysite.com/about/?affid=1234). ...
0
votes
1answer
156 views

How to keep a variable in COOKIE or GET query string?

I'm working on adding a language variable (locale) in my custom WordPress theme. I made the translation working by adding ?l=en_US to the URL. I would like to add the parameter into COOKIE, such that ...
0
votes
1answer
39 views

Cookie Details Requested

We have Wordpress 3.4 installed and looking for details regarding functionalities of cookies created by wordpress. This information is needed so that we can align with EU cookie laws. So please ...
0
votes
1answer
423 views

Do I use cookies?

I have made website in wordpress, and now client wants to know do this website use cookies? I dont know too much about it becouse i never use it, but i need to be sure. If I make websites i use ...
0
votes
2answers
860 views

How to force “remember me” users to login again?

My question is how to force the users that are auto-logged in because they previously checked "remember me" to log in again? It may be something with cookies, but is there anything I can ...