Logout button for the login plugin
-
Hi
I’m using the login plugin and the 24 hour cookie to let people access their records.
How do I create an logout button to let another user sign in?
-
The only reason you’d need this is if someone on the same computer wanted to access a different record…is that what you need?
Exactly!
I’m guessing we just need to delete the pdb-cookie – But how do you do that with a click of a button?
OK, it was easy to add, so in version 1.9.5 of the Participants Login plugin, you can add ?pdb-logout to the URL for your login form and it will clear the cookie and let you log in again.
for example if your login form is on a page named ‘pdb-login’:
https://xnau.com/pdb-login?pdb-logout-
This reply was modified 9 years, 9 months ago by
Roland Barker.
Thank you!
Just one thing to point out: When I log out and tries to log in on the same page, I’m redirected as i should, but the record page still displays the “no records was found” error text and the cookie isn’t created again.
Looks like I made an error…I’ve issued an update to fix it. Thanks for letting me know.
After the update a previous error occurred:
When I login with domain.com/login I’m redirected to domain.com/record (as expected)
If I go back to the domain.com/login – I should be redirected back to the record – I’m not!
Instead I’m redirected to domain.com/?page_id=454 – But I have no page with id=454No matter what I change in the “record page” setting, I’m still redirected to id=454 ?
The only workaround is to disable the “Use Cookie” setting or delete det cookie/log out.
After deleting the cookies, does it work?
Try refreshing your permalinks.
Also, make sure your “Participant Record Page” setting is correct.
-
This reply was modified 9 years, 9 months ago by
Roland Barker.
I had a closer look at this, should be working for you…what is the shortcode you’re using for the login form?
When I delete the cookie or disable the cookie setting it works, but when I enable it again, the same error appears.
I tried refreshing my permalinks.
The “Participant Record Page” setting is correct.
I’m using [pdb_login] for my login form.
See reply above
Is the “Participant Record Page” (Record Form tab in the Participants Database settings) setting correct?
Yes, I already answered that question above
-
This reply was modified 9 years, 9 months ago by
arr0w.
Sorry, missed that.
If that setting is correct, and the user isn’t going to the correct page after completing the login form, there may be an issue with your permalinks. The fact that you are getting the query string format suggests this might be the case. Try flushing the permalinks.
Another thing to check is in the login form, take a look at the HTML, there will be a hidden field named ‘pdbx-ser’ that holds the name of the page with the [pdb_record] shortcode where the user is supposed to be redirected to.
I tried flushing with no success.
When I take a look in the HTML, everything looks fine. This is only possible when the user is not logged in, because when I am logged in, I’m redirected to the wrong record page.
Please referer to this ticket, with the exact same problem – and here you managed to fix it (see the bottom): https://wordpress.org/support/topic/hide-private-id-in-url-on-load/#post-8445651As I said this problem has only something to do with the “Use Cookie”. Because, when this setting is turned off everything works fine (also the case in the link above). An important note is that this only applies when the user is ALREADY logged in and tries to access the domain.com/login page.
OK, looks like the cookie wasn’t getting read, so I fixed that.
-
This reply was modified 9 years, 9 months ago by
The topic ‘Logout button for the login plugin’ is closed to new replies.