Biscotti is a plugin that modifies the expiration of the logged in user cookie in WordPress to three months, six months, or one year. Because some people hate to have to keep entering their passwords.
As of version 2.1.0, Biscotti includes WP-CLI commands for managing a user’s logged in session cookie expiration.
This command returns the previously defined cookie expiration of a user.
<user_id> — The ID of the user.
This command sets the logged in session cookie expiration of a user.
<user_id> — ID of the user. <expiration> — New expiration duration. It must be one of the following values: `'3 months'`, `'6 months'`, `'1 year'`
Please remember to replace the
expiration placeholders with the actual user ID and desired expiration duration when running either of these commands.
To install this plugin, drop
biscotti.php into your site’s
wp-content/plugins directory and activate it.
How do I work this thing?
Once the plugin has been activated, a new option will be available in the WordPress dashboard under “User -> Profile” called “Login Cookie Expiration”. There, you can select the cookie expiration date of 3 months, 6 months, or 1 year on a per-account basis.
After updating this setting, you will need to log out and back into WordPress for your new cookie expiration value to take effect.
Enjoy your long cookie!
Contributors & Developers
“Biscotti” is open source software. The following people have contributed to this plugin.Contributors
Added WP-CLI command. Bumped required PHP version to 8.0.
@webaware has decided to help make this code less awful and submitted a pull request on GitHub. This release implements their improvements.
Sanitize. Not escape. Ack!
Forgot to escape the lone
$_POST in my code. Feel dumb about it. Fixed now tho.
Rewrite! Now, instead of forcing everyone to use the same login cookie expiration, Biscotti allows users to individually select their login cookie expiration on their profile page.
Initial release. Simple plugin that forced login cookie expiration for every user to 1 year.