HTTP and HTTPS differences for function is_user_logged_in() in WordPress 4.0
-
After upgrading to WordPress to 4.0, I find that the function is_user_logged_in does not work where the user signs in with HTTPS, but then returns to HTTP for browsing non-private areas.
I have an apache rewrite rule that redirects some paths to https due to account-specific information, but everything else, I redirect to http for less overhead.
On the site, there is a navigational bar that shows who the current user is at the top. After the user signs in, the navigational bar doesn’t show the user is signed in when it’s http, but it does for https. So this leads me to believe that the cookie to determine if a user is signed in checks for http vs https.
I tried setting the AUTH_KEY and SECURE_AUTH_KEY as the same hash, as well as AUTH_SALT and SECURE_AUTH_SALT to see if that help, but I still have the same problem.
After some digging, it seems that the cookie set after signing in HTTPS will not be available to WP in HTTP.
I’d prefer if I didn’t have to force all users to go HTTPS if they’re signed in. I’m open to ideas.
- The topic ‘HTTP and HTTPS differences for function is_user_logged_in() in WordPress 4.0’ is closed to new replies.