spring-guides / gs-securing-web

Securing a Web Application :: Learn how to protect your web application with Spring Security.
http://spring.io/guides/gs/securing-web/
Apache License 2.0
364 stars 447 forks source link

this example doesn't work in localhost but work fine with localhost.com #52

Closed edfeff closed 1 year ago

edfeff commented 4 years ago

desc:

  1. visit http://localhost:8080/login in chorme ,then sign in with 'user' and 'password'。
  2. this chrome is not redirect to http://localhost:8080/hello ,it still in http://localhost:8080/login ,and the input is empty ,just like refresh this page。
  3. when i input http://localhost.com:8080/login ,this example worked。

my /etc/hosts file:

127.0.0.1 localhost 127.0.0.1 localhost.com

so, what's the problem about localhost and localhost.com,can you help me?

olegkamuz commented 4 years ago

Same here, fixed by explicitly using 127.0.0.1:8080 or [::1]:8080

Buzzardo commented 1 year ago

It works for me. I suspect you have a hosts file problem or something similar. Ask on Stack Overflow, which gets much more traffic than this issue.