-
☆ A M B ☆
- 24,524 Posts
Thank you for your answer. I am not sure whether this logout function is for PageLocker or not but it doesn't seem to work. I think this is for normal MODX logins not for pages which are locked by PageLocker. Am I right?
Effect by using this is that i am redirected to login page by pressing logout button. After entering the locked page's url it is shown without the need to login.
-
☆ A M B ☆
- 24,524 Posts
Ah. I presumed that PageLocker required a user to be logged in.
Does nobody know how to do this? I really need help with this.
-
☆ A M B ☆
- 24,524 Posts
Well, looking at your code, you don't start a session in MODX snippets. MODX already has its own session that is being used. I'm not at all familiar with just what PageLocker is doing, but if it sets a SESSION value for its own status, and you know what it is, all you need to do is unset that SESSION value.
I'll check it out and see if I can figure out exactly what SESSION value you need to unset. You definitely do not want to start another session, nor do you want to close the existing MODX session.
-
☆ A M B ☆
- 24,524 Posts
Looks like you just need to unset $_SESSION['loggedin'], and maybe $_SESSION['groups'] and $_SESSION['password']. I would also be inclined to redirect to some specified page.
Ok, now I have another problem. Logout works perfectly but if someone presses browser's back button it logs in automatically. I am not sure how to solve this.
For example Crome asks to send the form again.
Does anybody know how to prevent this?
I'm wondering if you were able to resolve this. My client doesn't want the pw to appear in the field when they return to the page.
Any help would be greatly appreciated.