1. 08 11月, 2019 2 次提交
    • A
      Handle cookies more robustly · a1d6bcb8
      Asher 提交于
      If you visit /login/ instead of /login the cookie will be set at /login
      instead of / which means the cookie can't be read at the root. It will
      redirect to the login page which *can* read the cookie at /login and
      redirect back resulting in an infinite loop.
      
      The previous solution relied on setting the cookie at / (any invalid
      value works) which then overrode the login page cookie since
      parseCookies only kept a single value. So the login page would see the
      same cookie the root was seeing and not redirect back. However, that
      behavior depends on the cookies being in the right order which I'm not
      sure is guaranteed.
      
      This new method tests all available cookies and always sets the cookie
      so the root path will be able to read it in case the login page is
      seeing a cookie the root can't.
      
      It also goes a step further and explicitly sets the path on the cookie
      which fixes the case where there is a permanent misconfiguration
      redirecting /login to /login/. Otherwise the cookie would continually be
      set on /login only and you'd have another loop. It also means you only
      need to delete one cookie to log out.
      
      Lastly add some properties to make the cookies a bit more secure.
      a1d6bcb8
    • E
      Clear password when redirecting to login · 727ac648
      ecrode 提交于
      Should prevent endless redirects when the cookie is set on a different path or domain (like with a dot prefix).
      727ac648
  2. 07 11月, 2019 1 次提交
  3. 06 11月, 2019 1 次提交
  4. 05 11月, 2019 2 次提交
  5. 01 11月, 2019 1 次提交
  6. 31 10月, 2019 1 次提交
  7. 30 10月, 2019 8 次提交
  8. 29 10月, 2019 6 次提交
  9. 28 10月, 2019 1 次提交
  10. 26 10月, 2019 4 次提交
  11. 25 10月, 2019 5 次提交
  12. 24 10月, 2019 4 次提交
  13. 23 10月, 2019 4 次提交