Gd-login page redirects to homepage

This topic contains 53 replies, has 5 voices, and was last updated by  sithonia 7 years, 11 months ago.

We have moved to a support ticketing system and our forums are now closed.

Open Support Ticket

Tagged: 

  • Author
    Posts
  • #345282

    Paolo
    Site Admin
    Post count: 31206

    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

    #345288

    sithonia
    Full Member
    Post count: 63

    OK, 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…

    #345298

    Paolo
    Site Admin
    Post count: 31206

    I’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.

    #345302

    sithonia
    Full Member
    Post count: 63

    OK, 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!

    #345409

    Paolo
    Site Admin
    Post count: 31206

    You are welcome, sorry that I couldn’t do more 🙂

    #345712

    sithonia
    Full Member
    Post count: 63

    So 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?

    #345715

    Stiofan O’Connor
    Site Admin
    Post count: 22956

    That 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

    #345720

    Paolo
    Site Admin
    Post count: 31206

    After 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

    #345721

    sithonia
    Full Member
    Post count: 63

    So 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.

    #345728

    Paolo
    Site Admin
    Post count: 31206

    The 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

    #345886

    sithonia
    Full Member
    Post count: 63

    Contacted 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.

    #345892

    Paolo
    Site Admin
    Post count: 31206

    What 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

    #345902

    sithonia
    Full Member
    Post count: 63

    PHP version is PHP 5.6.29.

    #345940

    Paolo
    Site Admin
    Post count: 31206

    I’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

    #346066

    sithonia
    Full Member
    Post count: 63

    So 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.

Viewing 15 posts - 31 through 45 (of 54 total)

We have moved to a support ticketing system and our forums are now closed.

Open Support Ticket
20% Discount Offer
Hurry! Get your 20% discount before it expires. Get 20% Discount