Basically I had a plugin that allows you to set the URL that you want to be re-directed to upon logging out of the system. I was writing this to the database and then using the member_member_logout hook to log out of the system and then using the $FNS->redirect to get the user to where I wanted to send them to.
With the Login Redirect method that I have now added to the WIKI I am now handling this with a cookie on the users machine which is then used within the return=”“ parameter in the login form tag.
My problem with that one was when I made the extension I unfortunately didn’t quite understand how to program using the hooks effectively so pretty much ended up just copying most of the mod.member_auth.php into the extension and then changing the redirect to go where I wanted.
I definitely need a better understanding of how to use the hooks as I have lots of ideas that could (I think) be implemented into ExpressionEngine but I just didn’t know how to do them.
For instance with the Login Redirect extension which I made (now no longer on the forums due to licensing rules) I just wanted to change the return variable which was quite a way down the code in the php file after where the hook started but I didn’t know how to create all the same needed functions to log the person out and so that is why I ended up just taking the code from the file and adding it into the extension.
I thought that I needed the information to stay across a page as I was using a plugin to write the URL to the database and then when a person clicks on a logout link the extension kicks in and logs them out then re-directs them to the URL.
Is there an easier way and can sessions be used for maintaining state?
I would love to learn how to do this with an extension as I would really love to learn how to write them correctly.
Any help with this would be massively appreciated.