I’m currently in the process of migration to a full https setup on our sites, but I’ve run into a problem with the ajax login functions of the theme (Newspaper latest version).
No matter what I try login fails / cookies are not written when using the ajax login. I’ve tested a standard wordpress admin login and that works with a hitch.
Has the theme and all underlying functions (including ajax login) been tested on a https setup?
Just found another thread describing the exact same problem except I do not have any permission errors.
-
This reply was modified 9 years by
Phonetic.
Hi,
Please also test on a sub-domain. An ‘untouched’ site with no customization or optimization. The ajax login was tested with http and https and it works as expected for thousands of users. There must be an external cause affecting the login. We have multiple testing sites that run on https and we do not encounter any issue with the ajax login.
Thank you!
Found a solution. Changing the static function login_user in td_login.php
from:
static function login_user($username, $password) {
$credentials = array();
$credentials['user_login'] = $username;
$credentials['user_password'] = $password;
$credentials['remember'] = true;
$user_obj = wp_signon($credentials,false);
return $user_obj;
}
to:
static function login_user($username, $password) {
$credentials = array();
$credentials['user_login'] = $username;
$credentials['user_password'] = $password;
$credentials['remember'] = true;
$user_obj = wp_signon($credentials, true);
return $user_obj;
}
fixes the problem: wp_signon($credentials, true). One can also use wp_signon( $credentials, $secure_cookie )
Hey @Phonetic
Countless thank you to you, my dear. It worked perfectly well 🙂 You solved the long-awaited issue that I was facing here: https://forum.tagdiv.com/topic/still-facing-login-redirect-issue-with-ajax-based-login-popup-of-newspaper-theme/ . Even TagDiv team tried to solve it, but they couldn’t. You did it my friend. So, thank you.
Though it’s interesting to know why TagDiv hasn’t set wp_signon($credentials, true )? Why is it set to false by default? Is there any security reason behind it?
Will wait if someone from TagDiv can comment on it.
Regards.
