I’m still using v2.x. Yes - I promise to update soon!
I have restricted access to a template using HTTP Authentication.
How do I put a link on the template to enable the user to logout?
I feel it should be very easy but have not found a way so all help would be much appreciated.
I’d prefer not to use a plugin as that only complicates the upgrade to ee3
Thank you, Kurt that is exactly what I wanted and it appears to log the user out (they get the ‘You are now logged out.’ message and are diverted to another page) but they still have access to the restricted page without logging in again! They are only logged out when they close the browser.
Do you have any further suggestions?
HTTP Auth isn’t build with the ability to logout in mind. In real, it’s a mess. There are a lot of “solutions” and workarounds flowing around. You can google for it or maybe look here: http://stackoverflow.com/questions/449788/http-authentication-logout-via-php Maybe you get inspired….
Good luck, Ingo
I used Template>Access to set permissions.
If I enable HTTP Authentication in that dialog, users have to login to view the page as intended but the logout doesn’t work (it shows a logout confirmation but the user can still view the page without logging in again).They are logged out only when they close the browser.
If I disable HTTP Authentication, then anyone can view the template without logging in.
Thanks again. I disabled HTTP Auth, cleared the caches and re-enabled HTTP/Auth as suggested.
Users are still not being logged out.
The thing next to the ‘View’ link in the image is, I think, a key. It disappeared when I cleared the caches.
The only add-on that I think could be affecting things is the Member Management Module. It seems an unlikely culprit
You misunderstood something. You should leave HTTP Auth OFF. Turning HTTP Auth on adds a second Auth method. If you have HTTP Auth off, only the selected member group can view the template ( page ) if logged in. If you turn HTTP Auth on, only the selected member group can view the template, but have also provide user / password again. Got it? Hope this helps, Ingo
Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.