Saturday, June 11, 2022
HomeWordPress DevelopmentWordPress login set cookie that survive browser exit (wp_signon perform)

WordPress login set cookie that survive browser exit (wp_signon perform)


I’ve learn all of the related query right here on StackExchange and I have not discovered an answer.
Here is the issue: I take advantage of a plugin to make use of Google OAUTH to login in WordPress. All working accurately, however I am unable to set the “keep in mind me” choice to true as a result of the OAUTH login would not use this selection.
So, the login cookie cannot survive the browser session, and I need to login once more everytime the browser’s shut.

So, I’ve discovered that the WP Core perform wp_signon (in wp-includes/person.php) assume that “keep in mind me” is fake by default; so I’ve tried to invert the logic straight in core, inverting true with false and viceversa;

if ( ! empty( $credentials['remember'] ) ) {
        $credentials['remember'] = false;
    } else {
        $credentials['remember'] = true;
    }

doing so, i can login utilizing OAUTH and the login cookie survives the browser session for 14 days.
Now, what is the right method to completely allow this behaviour? On the following replace the Wp Core recordsdata will likely be overwritten…

Thanks for any recommendation.

RELATED ARTICLES

LEAVE A REPLY

Please enter your comment!
Please enter your name here

- Advertisment -
Google search engine

Most Popular

Recent Comments