WordPress.org

Ready to get started?Download WordPress

Forums

Sexy Login
[resolved] how to fix logout issue (8 posts)

  1. jason102178
    Member
    Posted 1 year ago #

    HI,

    I am having a small issue i was wondering if you could help me fix, i love the plugin so far is does everything i want . the only issue i have expeierenced is the logging out...

    If i am on the front page of my forum it logs out just fine..
    the same address it would be is http://example.com/blog

    but my site uses permalinks and if i am on a topic is will go to a the error page 404 not found because it is missing a slash

    this is what an example article should look like upon logging out
    http://example.com/blog/2012/article

    and when i am on an article and click log out it goes to
    http://example.comblog/2012/article

    http://wordpress.org/extend/plugins/sexy-login/

  2. jason102178
    Member
    Posted 1 year ago #

    sorry correction when i log out on an article the address looks like this

    http://example.com/blog2013/article
    so is not not putting a slash in between blog and the year

  3. OptimalDevs
    Member
    Plugin Author

    Posted 1 year ago #

    Hi jason102178.

    We are trying to reproduce the same issue but we can't, the plugin is working as expected.

    Please tell us if you are using SSL logins and the custom structure links in your WordPress ( Settings -> Permalinks -> Custom Structure, something like this: /%year%/%monthnum%/%postname%/).

    In advance, you can fix temporaly this issue editing the sexy-login-widget.php file in the plugin root. Localize the line 46 and replace:

    wp_logout_url( sexy_login_current_url() )

    with:

    wp_logout_url( site_url('/') )

    Thanks for the feedback, and sorry for the mistake.

  4. jason102178
    Member
    Posted 1 year ago #

    Hi

    Yes and yes to both, yeah i am using ssl and yeah i am using custom permalinks,. this is my current permalink structure
    /%year%/%postname%/

    and the fix you gave me works, however i was wondering by using this temporary fix, is it suppose to redirect you

    for example if i am on example.com/blog/article, it will redirect me back to the main homepage example.com/blog

  5. jason102178
    Member
    Posted 1 year ago #

    i personally thought that when you click logout if you were on an article page it would remain on that page and not redirect back to the main part of the blog

  6. OptimalDevs
    Member
    Plugin Author

    Posted 1 year ago #

    We have tested your custom structure and ssl logouts but all works fine. Probably the missing of a slash it's caused by some bad configuration in the .htaccess file or by other plugin. We really don't know. If the "sexy_login_current_url()" function is failing, you must have the same issue when a user logging on a topic.

    A new version of Sexy Login is coming, and we will take a careful look into this part.

    The final fix for your special problem must be replace:

    wp_logout_url( site_url('/') )

    with:

    wp_logout_url( $_SERVER['REQUEST_URI'] )

    And if the problem persist, replace with:

    wp_logout_url( 'https://' . $_SERVER['HTTP_HOST'] . '/' . $_SERVER['REQUEST_URI'] )

    Thanks again, waiting for your response.

  7. jason102178
    Member
    Posted 1 year ago #

    Thank you so much you have been very very helpful the final solution you provided to me worked perfect
    wp_logout_url( $_SERVER['REQUEST_URI'] )

    now if user logs out they remain on the same page without being redirected...

    you mentioned you tested the custom structure and ssl and all works fine, and that the missing slash could be caused by some bad configuration in .htaccess , is this something i should be concerned with or take a look into trying to fix, i didnt know if it was going to hurt anything or not

  8. OptimalDevs
    Member
    Plugin Author

    Posted 1 year ago #

    We're glad we were able to help.

    Don't worry about the .htaccess file if it's all works right. WordPress can be disconcerting sometimes. Check your WordPress Address and Site Address in "Settings -> General" and make sure they are correct. That's all.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags

No tags yet.