# Logout and login behavior for the plugin

updated (2024-05-06) for version 0.9.1

The logout an login behavior of the plugin is somewhat complex and require an explanation.

## Expected behavior

### login
When the user is not logged into the plugin but is logged into Exodox host (and cookies are allowed)
    ->the plugin redirects to the check_login page of the host app
    ->the host redirects to the login request page in the plugin with appropriate information
    ->the plugin do an automatic login of the user and redirects to the page of origin
    ->the user may not notice the login behavior.

when the user is logged into the plugin but not the exodox host
    ->the user is displayed the login page on the exodox host unlock page and may login att that point.
    ->the host unlocks the content for the user 
    ->the host redirect to the login request page in the plugin with appropriate information
    ->the plugin login the user and redirects to the page of origin

when the user clicks the unlock button without having been logged in.
    ->the user is displayed the login page on the exodox host unlock page and may login att that point.
    ->the host unlocks the content for the user 
    ->the host redirect to the login request page in the plugin with appropriate information
    ->the plugin login the user and redirects to the page of origin

When the login differs between the plugin and the app
    ->the plugin will not know until you attempt to unlock something and then the case will be handled on the Exodox host unlock page

When cookies are not allowed and the user is not logged into the plugin
    ->the user is not logged in

### logout
When you call the logout address
    ->you end up on the wp login page in a logged out state

