Gd-login page redirects to homepage
This topic contains 53 replies, has 5 voices, and was last updated by sithonia 7 years, 9 months ago.
We have moved to a support ticketing system and our forums are now closed.
Open Support TicketTagged: login
-
AuthorPosts
-
January 18, 2017 at 7:54 pm #345282
Definitely not, the problem appears to be in the way cookies are handled by the Server.
You should ask for help to your server support/admin and ask them why after logging out, the WordPress function get_current_user_id() returns the ID of the previously logged in uses, even if he logged out.
Thanks
January 18, 2017 at 8:03 pm #345288OK, thanks for all this input. But I’m on self-managed VPS-hosting, so it’s hard for me to ask for too much troubleshooting when it comes to settings. Do you have any idea of what I could ask them to look for, or is it best to just say what you posted last about the way cookies are handled and the WordPress function get_current_user_id()?
Sorry, for bothering you with all these questions, but it’s just all above my head…
January 18, 2017 at 8:18 pm #345298I’m really sorry, but that’s above my head too. We are not server admins.
In addition, I’ve never seen anything like that nor I could find any hint searching on Google.January 18, 2017 at 8:26 pm #345302OK, I’ll see what I can do to get them to check it out. Thanks a lot for all the effort in checking things out and trying to figure it out. I’m really impressed and happy with the level of customer support you guys provide! Good work!
January 18, 2017 at 11:11 pm #345409You are welcome, sorry that I couldn’t do more 🙂
January 19, 2017 at 3:11 pm #345712So I contacted support on my server and they said right away that it sounds more like a wordpress or plugin problem, nothing with the server. They also tested the issue and this is what they said:
I could see that wordpress login/Register now/Forgot password works fine using this URL “http://dev.thassosgreece.com/wp-admin/
This means there is no issues in the server.The reported issue with this URL: http://dev.thassosgreece.com/gd-login/, this URL is not redirecting to proper signup page after signing out current session.
Please make sure that you have configured redirection correctly on your plugin ‘gd-login’.
So, sorry, now I’m coming back to you again…
Looking through some of the code I wondered what this code in geodir-signup.php does:
* If user is not signed in, redirect home. */ if (get_current_user_id()) { wp_redirect(home_url(), 302); exit; }
Could I just delete that and it wouldn’t redirect to the homepage anymore? Or what function does that code fill?
January 19, 2017 at 3:32 pm #345715That bit of code u mentioned above is what redirects a logged in user to the homescreen if they try to view the login screen when logged in.
The function “get_current_user_id()” is returning the user ID even when supposedly “logged out” this should be impossible and i have never seen it apart from caching. If you delete all cookies from the site then it works as expected.
Thanks,
Stiofan
January 19, 2017 at 3:41 pm #345720After a reply like that, the best thing to do is to change hosting provider. Consider that this is the only server we ever seen something like that in the past 5 years.
Thanks
January 19, 2017 at 3:43 pm #345721So why is the wordpress login page working normally? No problems with caching or cookies there.
What would the implications be if I delete that code that redirects? Is it so detrimental if a logged in user clicks to view the login screen?
I just have to make this work somehow. I think it’s important that the forgot password function works properly.
January 19, 2017 at 3:56 pm #345728The WordPress login page logs you out if you visit it while logged in, it doesn’t redirect you.
As I said, there are over +10000 website using our plugin and 1 presenting this problem.
The problem is server related and you should insist that they fix it, not find a workaround through the application.
Thanks
January 19, 2017 at 7:51 pm #345886Contacted my hosting again.
They say:
“Please note that it is a code level issue. You must check it with your developer or vendor, as there is nothing in the error log related with the server. Please ask them any function or php module needs to be enabled in the server.”So, are there any special functions or modules that should be enabled? Since I’m on self-managed VPS it’s very possible that it’s something I’ve missed to enable.
Thanks for your patience.
January 19, 2017 at 7:56 pm #345892What version of PHP are you on? It should be +5.6.
There shouldn’t be anything in particular installed for that function to return “false” when a user is logged out.
Thanks
January 19, 2017 at 8:19 pm #345902PHP version is PHP 5.6.29.
January 19, 2017 at 8:57 pm #345940I’m really sorry, but there is nothing else we can do to assist you in this case.
We found the error (cookies are not cleared properly), we don’t know how to solve it, especially because we never got across anything similar.
The only option left if you want to stay on that server, is to hire a system specialist and ask him to fix the server configuration, explaining him the problem in details.
Thanks
January 20, 2017 at 8:35 am #346066So I think I have figured it out…
It seems that the browser (not the server) is storing the cookie, giving the result of a user being logged in, though he is not. Thankfully if the browser is shut down and restarted, these cookies are cleared and the register and forgot password links work as normal. So, it’s only in case a user logs out and immediately asks for a new password that the problem will be displayed. That’s probably not very likely. He was just logged in, why would he ask for a password again?
It’s more likely he would return to the site after some time, and not remembering his password he asks for a new one. But since time has gone by, chances are he has meanwhile restarted his browser (which cleared the user-cookie) and so the login page should display properly.
I’m even tempted to say that my problem isn’t unique, the same issue would probably happen on the other +10,000 sites if those links are clicked right after a user has logged out. But since that isn’t likely to happen often, you haven’t received any complaints…
Seems like the troubleshooting was causing the trouble!
Thanks for your patient support.
I’m writing this, in case you do hear a complaint from someone else about it. -
AuthorPosts
We have moved to a support ticketing system and our forums are now closed.
Open Support Ticket