简体   繁体   English

ASP.NET MVC-“记住我”仅适用于本地主机

[英]ASP.NET MVC - “Remember me” works only on localhost

we have testserver for a ASP.NET MVC project. 我们有一个用于ASP.NET MVC项目的测试服务器。 Everything works fine on dev machines, but we can't login if "Remember me" checked in on the login page (in this case the request is redirected to the login page, no exception occurs as far I know). 在开发机器上,一切正常,但是如果在登录页面上签入“记住我” ,我们将无法登录(在这种情况下,请求被重定向到登录页面,据我所知没有异常发生)。

If we open a browser in RDP on the testserver, it's possible to use "Remember me" correctly as localhost - but remotely still fails. 如果我们在测试服务器上的RDP中打开浏览器,则可以正确地将“记住我”用作本地主机-但远程仍然失败。

The two web.config are equals (except the compilation debug row). 两个web.config等于( 编译调试行除外)。

Any idea? 任何想法?

Thanx in advance! 提前感谢!

Answer 回答

Servertime was wrong (minus 3 days) and cookie died too fast. Servertime错误(少于3天)并且cookie死得太快。

Pff...based on this article I found the answer quickly: the server time is wrong (it's a virtualized one and something happend) so cookie lifetime ends too fast. PFF ......基于文章中,我很快找到了答案: 服务器时间是错误的 (这是一个虚拟化的一个什么东西happend)所以cookie的生命结束得太快。

I do not delete this question maybe can be helpfull for others. 我不会删除此问题,可能会对其他人有所帮助。

Hmmm... 嗯...

You don't happen to have multiple servers on your testbed do you? 您不是在测试台上碰巧有多个服务器吗? Sounds like a classic machinekey problem if so. 听起来像是经典的机器钥匙问题。

(aside - always compare machine.configs too in cases like this!) (此外-在这种情况下,也总是要比较machine.configs!)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM