| 开发者 |
strangerstudios
norcross |
|---|---|
| 更新时间 | 2024年4月15日 19:21 |
| PHP版本: | 5.2 及以上 |
| WordPress版本: | 6.5 |
| 版权: | GPLv2 or later |
| 版权网址: | 版权信息 |
FAKESESSID for each user when they log in.FAKESESSID stored in the user’s cookies is the same as the last login stored in a transient (fakesessid_user_login).wp_bouncer_number_simultaneous_logins filter to allow a defined number of active "sessions".
View the Recipe
Example Use Cases for WP Bouncer
FAKESESSID, say "SESSION_A" is stored in a WordPress option.FAKESESSID, say "SESSION_B" is overwrites the stored WordPress option.FAKESESSID, "SESSION_A_v2" is stored in the WordPress option.wp_bouncer_ignore_admins filter: if returning false even admins will be bounced.wp_bouncer_redirect_url filter: can be used to change the URL redirected to after being bounced.wp_bouncer_number_simultaneous_logins filter: can be set to limit logins to a number other than 1. 0 means unlimited logins.wp_bouncer_login_flag: runs right before bouncing (can be used to potentially stop the bouncing).wp_bouncer_session_ids hook: used to filter session ids when saving them. Passes $session_ids, $old_session_ids (before any were removed/bounced), and the current user's ID as parameters.wp_bouncer_session_length hook: used to filter how long the session ids transients are set. This way, you can time the transients to expire at a specific time of day. Note that the transient is saved on every page load, so if you set it to 5 minutes, it's going to push it out 5 minutes on every page load. You should try to set it to (the number of seconds until midnight) or something like that.wp-bouncer folder to the /wp-content/plugins/ directoryWe've found that using a 2-Factor-Authentication scheme on your site is a good way to keep people from sharing accounts. When we tried to design an advanced version of WP-Bouncer, it was basically 2FA. So try that.
wp_bouncer_ajax_timeout to adjust timeout (default 5000).define( 'WP_BOUNCER_HEARTBEAT_CHECK', true ); to your wp-config.php (without the backticks).