The tag has no wiki summary.

learn more… | top users | synonyms

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
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 ...
0
votes
1answer
37 views

Error when setting cookie

I get this error when trying to set a cookie on a WP page. Warning: Cannot modify header information - headers already sent by(...) Any help here? It worked fine when I did the php outside of ...
0
votes
1answer
79 views

Authentication from sub-folder non-wp cookie WordPress

I have a question about user authentication in my WordPress Multisite site. My site is http://www.drezzy.it that has its own user db with a login and logout system. This is a non-WP website. When you ...
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' ); ...
0
votes
1answer
61 views

set cookies for my whole site is not working

I'm trying to set the cookie to my site to hide a div on click action. Description of the problem. I wanna set the cookie for the whole site not for particular page. I'm setting the cookie on click ...
0
votes
1answer
336 views

Why is PHP Cookie via plugin only set when logged in as Admin and not regular users? and other questions

At first I thought it was a browser issue, but it looks like my code only sets a cookie if the user is logged in the administrator. If you are not logged into the Administrator account then it does ...
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 ...
0
votes
0answers
124 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
1answer
203 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 ...
1
vote
0answers
81 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 ...
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 ...
0
votes
1answer
158 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 ...
0
votes
1answer
314 views

wp-admin won't “remember me” in Chrome & Firefox

When I login to wp-admin, I tick the box to "remember me", so I don't have to login again next time. However, if I close the wp-admin tab, and reopen wp-admin in a new tab, I have to login again. ...
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 ...
0
votes
1answer
298 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 ...
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 ...
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 ...
0
votes
0answers
71 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
1answer
1k views

Secure wordpress_logged_in cookie

I have to make sure, that the Wordpress cookie set after successful log in, "wordpress_logged_in_[salt-sth]" is set to be available for secure connections only. It looks like that it´s a filter used ...
0
votes
1answer
249 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), ...
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 ...
0
votes
1answer
24 views

How to save a viewer specific option

A minimal example of my problem would be default background colour is white a custom sidebar widget offers to switch background colour to green when switched to green, background shall stay green ...
1
vote
1answer
652 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 ...
0
votes
0answers
553 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 ...
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 ...
0
votes
1answer
75 views

Caching for logged in user and Ajax update

I would want to serve the homepage with a cached version of the page for both logged in and new users. And then to use Ajax to update the content appropriately, for example if the user had already ...
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 ...
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 ...
0
votes
2answers
727 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
285 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 ...
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
382 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 ...
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. ...
0
votes
2answers
376 views

How to set different cookies for logged in admin users and logged in non admin users?

I would like to identify admin users and non-admin (but logged in) users through cookies. I need this feature because I use Hyper Cache (which uses cookies to identify those who send pages in cache): ...
0
votes
1answer
351 views

Add session or cookie to remember last menu location

I have a site that is pretending to be three sites. This is done by a series of conditional statements and page templates to make it look like the user is on a different site depending on their menu ...
0
votes
1answer
79 views

region selection

I'm developing a website, where the visitor has to choose it's region Europe / Asia, according to this choice the menu should be different, (most pages are the same). When I would develop this in ...
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. ...
0
votes
1answer
121 views

Lead Generation with Cookies in Wordpress

New Edit I would like to show the_content BEFORE the more tag when the cookie is not set and the_content AFTER the more tag when the cookie is set. I could not answer to my own question because ...
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 ...
0
votes
1answer
40 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 ...
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 ...
0
votes
1answer
843 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 ...
1
vote
0answers
125 views

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

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 ...
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. ...
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 ...
0
votes
2answers
469 views

WordPress Post Voting - Vote once per IP on entire site

I've been researching this for a few days now and found many voting plugins - unfortunately none of them do exactly what I need, so I am trying to hack some functions/scripts that I've found by ...
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 ...
0
votes
2answers
186 views

Serving wp-includes (front-end) javascript from a different domain?

The WordPress Codex points to an extremely simple way to change the URL of the wp-content directory, which is, adding this in wp-config.php: define( 'WP_CONTENT_URL', ...
0
votes
1answer
89 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. ...