Hiya,
Could you possibly give the attached new version of the extension a go and see if this works instead?
New version in post below
Just tested it here on 1.6.3 and seems to be working fine now. If it does work then I will take a better look at where I went wrong with it all.
Let me know how it goes.
Best wishes,
Mark
Nope, still no go Mark. I didn’t get the warning messages this time, but the logout redirect still doesn’t work.
Here’s what I’ve got for my redirect:
{exp:logout_redirect url="http://www.kentuckygolfing.com/{segment_1}/{segment_2}/{segment_3}" text="Logout" styles="class='logout-link-class' title='Logout Link'"}
It is still redirecting me to Yahoo’s homepage even though yahoo.com isn’t anywhere to be found in the template code.
Also, I’m not sure if this is by design or not, but when I hover of the link it is still showing “http://www.kentuckygolfing.com/?Act=10” as the URL in the status bar.
Hi Deron,
Sorry about this. Not too sure what is wrong there then. What version of ExpressionEngine are you running this on?
Also you may need to go and delete the table that the extension has installed to your database because if it isn’t getting removed correctly (although now it should be - perhaps try removing and re-installing the extension a couple of times) then if you had yahoo as the place to re-direct to but that isn’t getting written over in the database then this would cause that kind of behaviour.
So the first thing to try would be disable the extension and re-enable it a couple of times and then try again. If that doesn’t do it then you may need to disable it and then delete the exp_logout_redirect table that was created and then try re-enabling the extension again.
I just tried this on another 2 fresh installs of 1.6.3 and they both worked fine each time so I think there must be something stuck in the piping somewhere.
I was actually thinking of re-making this so that it doesn’t use any database tables actually as the whole thing could be sorted by setting a cookie value and then using that instead. I may look at doing that if I get the time some day soon.
Anyway hope that works for you?
Let me know how it goes.
Best wishes,
Mark
Version 1.6.3 Mark. Still a no go. I’ve deleted the table in the database and deleted all instances of the ext/plugin from my system folder and re-enabled everything and tried it again and again it takes me to yahoo.com.
So… I guess I’ll let the default logout be for now. I’m not exactly sure that the extension will do what I need anyway so maybe once I get everything else finished on this site I can revisit this problem and see what happens.
Thanks Mark.
EDIT - New version of extension is attached to the first post in this forum thread
Oops!!!! Please tell me I’m not really THAT stupid am I?!!! 😊 😉 😊
New extension added to the end of this post and I will delete the one above. I had hard-coded Yahoo into the extension whilst I was testing and had forgotten to take it out again afterwards!!!
What an utter plonker!
This version should hopefully work for you 😉
Best wishes,
Mark
Hi Sue,
I was going to do that but I think that I might add in two versions instead. The reason being that I am not too sure why it suddenly stopped working and as I mentioned before I originally wrote this for a much earlier version of ExpressionEngine and was just following one of the examples from the documentation and so I guess that things have changed a bit since the time when I first made it so was offering up this new version in the hope that it would work although at the moment it seems as though it isn’t working correctly for some reason although I’m not having a problem this end on new installs so I would rather make sure that it is definitely working perfectly before getting rid of the one in the first post if that’s okay?
I do know about the unwritten law actually and always try to do that with my other plugins and add-ons where ever possible so will definitely do that with this one once I have pin-pointed just exactly what is going on with this, or I re-write it to use a cookie instead.
I don’t suppose you would like to test out the latest version of this - two posts above would you Sue and let me know if you have any joy with it? 😉
I’m just wondering if it is something on my system that is allowing me to get this working correctly? One other thing Deron - what version of PHP are you running on your site?
Best wishes,
Mark
Hi Deron,
Yep sorry about that. Leaving in test code when you post it as a new version is probably not a good thing to do now is it!! 😉
I will delete the one from above and point to the first post where I will update that version. I have also changed the description slightly when you go to your Extensions manager as I did originally have this working from a setting in the Extensions Manager but that meant that you could only ever log out to the one page and this way is much better. You can leave yours as it is though if you’re not bothered by it or just download the extension from the first post (once I have done that!) and upload it over the top of the existing one.
Just out of interest how are you using this on your site then Deron. Always nice to know how people are using these things! 😉
Also when I get the chance I think I am going to move this one over to using a cookie instead of using the database. Admittedly it may not work in all cases if people obviously have cookies turned off but I think it might be better in the long run.
Best wishes,
Mark
Mark, please make sure you update the plugin link at the top of the thread. It’s become an unwritten law (or best practice) to have the most recent version of a plugin be at the top of the thread so people don’t have to go looking for the right one.
Hi Sue,
All working and done now 😉
Best wishes,
Mark
Hey Mark. I’m using it to redirect the user back to the page they were one before they clicked “logout.” By default, from what I can tell, EE will redirect the user to the homepage once they have logged out and I don’t like that functionality.
So, here’s what I’ve got:
{if segment_1 != ""}
{exp:logout_redirect url="http://www.domain.com/{segment_1}" text="Logout" styles="class="logout-link-class"}
{if:elseif segment_2 != ""}
{exp:logout_redirect url="http://www.domain.com/{segment_1}/{segment_2}/{segment_3}" text="Logout" styles="class="logout-link-class"}
{if:elseif segment_3 != ""}
{exp:logout_redirect url="http://www.domain.com/{segment_1}/{segment_2}/{segment_3}" text="Logout" styles="class="logout-link-class"}
{/if}
Hi Deron,
Thanks for letting me know. Always nice to see how these things are being used. Yep it is nice to be able to re-direct people to where they just were instead of the usual behaviour which I think can in certain cases be a little disconcerting. Glad it’s all working for you now.
Best wishes,
Mark
Quick question, if I specify the {exp:logout…} in one template should I be able to specify it again in another template to get a different redirect at that time or am I only supposed to set this once in 1 template and thus I can only redirect on logout to one page of my choosing? When I try multiple times I go in a what seems to be a re-direct loop.
Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.