The tag has no wiki summary.

learn more… | top users | synonyms

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 ...
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 ...
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 ...
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 ...
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
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 ...
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
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), ...
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 ...
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
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 ...
0
votes
0answers
554 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
1answer
873 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
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
1answer
104 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
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 ...
0
votes
2answers
729 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). ...
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 ...
0
votes
1answer
286 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 ...
0
votes
1answer
315 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. ...
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
344 views

wp_signon returns user but the user is not logged in because wp installed on subdomain. How to make it work?

I am using the WordPress API to get the user login. My code: <?php define('WP_USE_THEMES', false); require('wp-blog-header.php'); $creds = array(); $creds['user_login'] = 'user'; ...
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 ...
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
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 ...
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 ...
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 ...
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 ...
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
471 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 ...
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. ...
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. ...
0
votes
1answer
595 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 ...
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 ...
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 ...
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 ...
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 ...
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.
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 ...
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 ...