[wp-trac] [WordPress Trac] #47468: Cookie Expiry & Login Popup causes loss of any work currently busy with
WordPress Trac
noreply at wordpress.org
Tue Oct 1 12:54:04 UTC 2019
#47468: Cookie Expiry & Login Popup causes loss of any work currently busy with
--------------------------+------------------------------
Reporter: mitchellk | Owner: (none)
Type: defect (bug) | Status: new
Priority: normal | Milestone: Awaiting Review
Component: Users | Version: 5.2.1
Severity: normal | Resolution:
Keywords: | Focuses:
--------------------------+------------------------------
Comment (by mitchellk):
Seems there is no intention of ever offering a simple setting for users.
Rather just hardcode things like this without having any switched or
settings for users. Great approach. Might as well just close the issue.
For those wanting a fix, here's a simple PHP snippet to add to your
functions.php of your theme.
{{{
add_filter( 'auth_cookie_expiration', 'keep_me_logged_in_for_1_week' );
function keep_me_logged_in_for_1_year( $expirein ) {
return 604800; // 1 week in seconds
}
}}}
or
{{{
add_filter( 'auth_cookie_expiration', 'keep_me_logged_in_for_1_month' );
function keep_me_logged_in_for_1_year( $expirein ) {
return 2628000; // 1 month in seconds
}
}}}
--
Ticket URL: <https://core.trac.wordpress.org/ticket/47468#comment:5>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list