1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Fixed Login and logout errors

Discussion in 'Resolved Bug Reports' started by Deebs, Mar 10, 2011.

  1. Deebs

    Deebs Well-Known Member

    Guys,

    On my test forum I am having problems logging in and logging out. It seems to be fairly consistent under IE8.

    Whenever I perform either action I get the following error:

    The resultant action is ok, I am either logged in or logged out but the error is displayed.

    I'll try and reproduce under FF.
     
  2. Mike

    Mike XenForo Developer Staff Member

    The last time I saw this, it was an Nginx misconfiguration.
     
  3. Mike

    Mike XenForo Developer Staff Member

  4. Deebs

    Deebs Well-Known Member

    Hmm, let me check the logs.
     
  5. Deebs

    Deebs Well-Known Member

    Have stripped back my config file to just the following:

    Code:
    server {
            listen xx.xx.xx.61:80;
            server_name testforums.somedomain.com;
    
            root   /data/websites/testforums.somedomain.com;
            index index.php;
    
            location / {
                   try_files               $uri $uri/ /index.php?$uri&$args;
            }
            location ~ ^(.+\.php)(.*)$ {
    
                    include /usr/local/nginx/conf/fastcgi_params;
                    fastcgi_index index.php;
                    if (-f $request_filename) {
                        fastcgi_pass phpfpm_backend;
    
                    }
            }
    }
    
    
    The problem still exists, looking in the logs I see the following:

    As you can see, the penultimate entry is giving a redirect which is then giving a 404 error and this then causes the error to be displayed.

    Doing the exact same thing in FF 3.6.15 gives the following log entries:

    Firefox is requesting different urls from IE8 to logout. Now if it was a configuration issue with nginx then surely I would see the same urls being asked for regardless, as that is a client side request.
     
  6. SneakyDave

    SneakyDave Well-Known Member

    I think I fixed mine by putting "root" directives in my location blocks. I think
     
  7. Deebs

    Deebs Well-Known Member

    Have tried that and it didn't work. My point still stands, from the server side logs IE8 is requesting a different URL from FF when logging out.
     
  8. SneakyDave

    SneakyDave Well-Known Member

    I saw the same thing for a while when I was trying to setup my forum as a sub domain, but I thought it was an nginx configuration problem too, I saw exactly the same thing, that FF and IE8 were sending different redirects.
     
  9. Mike

    Mike XenForo Developer Staff Member

    This should fix it.

    In library/XenForo/Link.php, add the lines in red:
    Code:
            if ($uri == '.')
            {
                $uri = ''; // current directory
            }
    
            if (substr($uri, 0, 1) == '/')
     
    SneakyDave likes this.
  10. Deebs

    Deebs Well-Known Member

    Mike,

    Applied the fix and can confirm it now works as expected in IE 8. Many thanks.
     
    SneakyDave likes this.
  11. SneakyDave

    SneakyDave Well-Known Member

    I guess I wasn't crazy. Thanks Mike.
     

Share This Page