The tag has no wiki summary.

learn more… | top users | synonyms

2
votes
3answers
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 ...
0
votes
1answer
18 views

Set cookie for visitor

I'm writing a new plugin that will allow visitor to vote. After a visitor rated a post, I'd like to block double voting. I think the better way to do it is using cookie, but of course I can't insert ...
0
votes
0answers
18 views

Get user info on sub domain from WordPress installed on main domain

I have WordPress installed at www.mainsite.com. When visiting the sub domain subdomain.mainsite.com, I would like to grab the user's email address if he or she is logged in on the main site. ...
1
vote
1answer
67 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 ...
2
votes
1answer
377 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 ...
0
votes
0answers
20 views

Wordpress Varnish Age=0 or Not Caching (Cookies?)

I'm using Wordpress 3.8.1 and Varnish 3.0.5. I'm sure the Varnish is not caching, because of the VCL nightmare. And i also don't know where is the very standard / correct VCL for Wordpress. My ...
0
votes
1answer
246 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
486 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 ...
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 ...
0
votes
1answer
45 views

One time login on 2 different Wordpress sites

Im trying to figure out how to login one time to mydomain.com and being automatically loged in to mydomain.com/blog . I have figured out how to share tables (so that the same users on my main site, ...
2
votes
0answers
60 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; ...
0
votes
0answers
41 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
114 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 ...
4
votes
1answer
333 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 ...
0
votes
0answers
48 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 ...
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.
0
votes
0answers
28 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
2answers
101 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
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
83 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
1answer
150 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
100 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
26 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
61 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 ...
1
vote
1answer
410 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
24 views

Override Theme Customizer Cookie Expiration

I'm working on a Multisite network which has a forked/custom signup form. As part of the signup success process the user is automatically logged in, given a password, etc. I've got this all strung ...
0
votes
1answer
47 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
150 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 ...
1
vote
1answer
134 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
66 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
119 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
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 ...
3
votes
1answer
331 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
55 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
195 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. ...
0
votes
0answers
43 views

WordPress Auth Cookie

I have 2 domains pointing on same WP installation, I want when user login under host1 (s)he be redirected to host2 and be logged in there too. Obviously because cookies under host1 aren't sent for ...
1
vote
2answers
287 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
172 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
0answers
122 views

Wp-admin error with cookie sharing while using SSL

I am using Wordpress 3.6 My setup is 3 separate wordpress installations on the same server: www.example.com, secured.example.com, my.example.com All 3 domains use WP-Orphanage Extended plugin so ...
3
votes
1answer
67 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 ...
0
votes
0answers
31 views

cookies creating bugs and interfering with js and correct images and css display when login in the back office

i have experienced weird behaviours with custom js functions output as well as contact form correct display. I have localised a problem being , everytime i connect to admin , i need then to clear ...
1
vote
1answer
1k 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
58 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
738 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
133 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
4k 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
23 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
425 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
317 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 ...
0
votes
3answers
467 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 ...