Auto login links can be used in an email to grant access to restricted content on your site without requiring a user to log in. You can even grant access to contacts in your CRM that don’t have user accounts on your site.
Keep in mind that the user will only be logged in for the purposes of WP Fusion’s content restriction and activity tracking features. For security reasons, users will not be able to access or edit their account details, purchase history, or any other sensitive information. For that they will need to log into your site using their username and password. All other plugins will see the visitor as a guest.
To use this feature, first enable it from the Advanced section of the WP Fusion general settings tab.
You can now log a user into your site by passing a contact ID in any URL pointed at your site, for example:
This sets a cookie and creates a temporary WordPress user with that contact’s tags and other information from your CRM. Any protected content will be accessible if the contact has the correct tags. You can also apply tags and track activity as if the user was logged in.
You can also use WP Fusion’s user meta shortcodes to display contact data from your CRM.
Ending auto-login sessions
WP Fusion will attempt to end the auto login session in several situations to prevent unexpected behavior on your site:
- When a user logs into the site with a username and password
- When a visitor reaches a page that contains “login” in the URL
- When a visitor reaches a page that contains “register” in the URL
- When a visitor reaches a page that contains “cart” or “checkout” in the URL
However you may also want to force the auto-login session to end at a different time, for example when a form is submitted. You can do this by appending
?wpf-end-auto-login=true to any URL.
You can also achieve this in PHP by calling