You could hook into template_redirect
and check a cookie.
Just an idea, not tested:
add_action( 'template_redirect', 't5_force_login_after_time_span' );
function t5_force_login_after_time_span()
{
$cookie_name="first_visit";
$now = time();
if ( is_user_logged_in() )
return;
if ( empty ( $_COOKIE['first_visit'] ) )
{
setcookie( $cookie_name, $now, $now + WEEK_IN_SECONDS );
return;
}
$first_visit = (int) $_COOKIE['first_visit'];
if ( ( $now - $first_visit ) > HOUR_IN_SECONDS )
auth_redirect();
}
Be aware this violates the law in some countries, see the EU cookie law.
Related Posts:
- Separate registration and login for different roles
- SSO / authentication integration with external ‘directory service’
- How to prefill WordPress registration with social details
- Woocommerce registration page [closed]
- WordPress registration message
- How to remove the WordPress logo from login and register page?
- Login email after registration never sent or received
- I want to disable E-Mail verifcation / activation when a user signs up for my WordPress site
- How do I check if a post is private?
- Receiving “This content cannot be displayed in a frame” error on login page
- How to customise wp-login.php only for users who are setting a password for the first time?
- What hooks should I use for pre-login and pre-registration actions?
- Change register form action url
- Problem with logging in WP users automatically
- Is it possible a one click user registration with Facebook or Twitter (or other Social Networks)?
- Register/Login using only phone number?
- Force users to register in order to view website [duplicate]
- How do I force “users must be registered and logged in” on subsites?
- auto login after registeration for wp-members plugin
- How To Change Wp Register/Login URL Permanently To My Custom Page
- How to modify the action attribute of the wp-login.php?action=register form?
- Correct passwords keep appearing as incorrect
- Disabling standard registration login with username/email and password?
- Login form doesn’t log in
- Get the url of custom login page in the registration page
- By registering always make uppercase the first letter of the login
- Show reCaptcha on Custom Frontend Login & Register Form [closed]
- Best option to implement external register/login to WP from self-made API
- Auto Login After Registration
- Disable all other page except index,register,login till user login
- What speaks against using a custom login.php / register.php to wordpress?
- How do I add Login fields and registration link to the header?
- How to make a user be able to register if such a login already exists?
- Sending new registration meta values to admin by email
- Are login functions considered part of the WP backend?
- WordPress registration page template
- Removing “public” user registration without completely turning it off?
- Disable registration on certain condition
- what is the best and safest way to allow users to register to site
- Updated : how to make email optional while user registration using default wordpress form
- Problem in auto login after registration
- How to invalidate `password reset key` after being used
- Updating usermeta from login redirect to billing address
- Chosen user password in registration is not being accepted on Login
- WordPress auto login user after registration only from a specific page
- User account activation links are lacking query strings
- Login user after registration programmatically
- How to get rid of the username of registration form in theme my login wp plugin?
- Where do I find “log in” and “register” link which are located on the top right corner?
- Registration and Login form
- WordPress and Magento: let WordPress manage user registration and logins?
- how to add custom word press regisration form in word press 3.5 with out module [closed]
- Click on banner to register to the blog
- How to put Login, Register and newsletter widget on the same page?
- make a login system for site visitors
- How to create a fully functional user registration in WordPress?
- Adding extra authentication field in login page
- Customize wp_new_user_notification_email()
- Need to execute a cron job
- How to keep always logged in development environment
- Add Confirm Password field in wp-login.php Password Reset page
- How to create custom LOGIN and REGISTRATION forms?
- send users logging in from wp-login.php directly to home page of site, rather than dashboard
- User logon by using mobile number [closed]
- Pre checking condition before login
- Redirect after empty login username and password
- Customizing the WordPress login form
- Login error redirecting to wp-login page
- Custom login message for single post pages only
- Private page protected with username and password
- Auto login between word press subdomain and a .net website
- How to retain comment text on comment form after login/registration?
- Custom Login form from WordPress site to non-WordPress site
- WordPress error on log out ‘Not Permitted’ and can’t log out
- Add logout link when logged in, make it disappear when logged out?
- Sidebar login widget with error print, returns an error
- Exclude login page from custom maintenance code
- Temporarily locked out … how long is a “short while”?
- Change default login auth
- I can’t access my WordPress dashboard – shows Warning message [closed]
- Add html to wp_login_form
- SQL – Remove All The Users and Create A New User With Admin Role Via PhpMyAdmin
- Can I protect a type of content site-wide with a single password?
- Sign in with social media accounts without creating a WP account [closed]
- WordPress login form script
- WordPress authentication using custom php?
- ERROR: Cookies are blocked due to unexpected output (no FTP access)
- How do I change the language of the login page to Arabic?
- How to post frontend login form to a different authentication script from wp-login?
- Problem with is_user_logged_in() function in some pages
- WordPress login loop on proxy setup with SSL – Apache proxy to IIS
- ERROR: Cookies are blocked due to unexpected output – ultimate solution
- Android app – can’t login: “This site already exists in the app, you can’t add it”
- backend access per user status
- Change “login/register” to “useraccount” when a user has logged in
- Enqueue script on logon failure
- I get 404 when I try to login ever since I changed the permalink
- Share login status across subdomains without network
- How to change the login URL
- Entire WordPress content disappears