I am wondering if it is possible to log out a webuser without using a log out button?
So instead of clicking on anything, loading any page that is outside of a certain group would contain a line of code that would terminate the logged in session.
Please let me know if this is possible.
Thanks!
-
☆ A M B ☆
- 2,475 Posts
You could put a Snippet on those pages... e.g. build a template that is used for all pages that would log out the user, and inside that template, but your "forced-logout" snippet. Any time one of those pages is loaded, the Snippet could force any logged in users to be logged out. Have a look at the existing logout Snippet(s) to see how to enforce this.
Yes, that’s what I was thinking though I can’t code in PHP (next thing to learn). I looked at Login snippet but that is way too complicated for me to dechiper.
If the snippet is quick to write could you give me an example?
No probs!
I want to start learning php soon so I hope eventually I will get a better grasp of the whole thing.
Thanks!
Can I ask ’Why?’
if a user opens another page on the site in a new tab, or window they are going to be logged out - possibly annoying
if a user merely closes the window or just surfs to a different site they will not be logged off...