gpt4 book ai didi

asp.net - .ASPXAUTH cookie 在 session 结束时过期

转载 作者:行者123 更新时间:2023-12-04 18:46:53 24 4
gpt4 key购买 nike

我使用 asp.net 的通用身份验证基础结构和身份验证控件(登录、注销等)

我的配置:

<authentication mode="Forms">
<forms loginUrl="~/Administrators/Login.aspx" timeout="500000" />
</authentication>

我希望看到 .ASPXAUTH cookie 会在明年过期,我不应该一次又一次地输入 login\passw

但是我看到这个 cookie 总是在 session 结束时过期。
我怎样才能改变这种行为?

编辑

当然我使用 checkox “记住我”。我认为 asp.net 应该创建持久性 cookie

最佳答案

如果要创建持久性 cookie,请使用:

FormsAuthentication.SetAuthCookie Method

FormsAuthentication.SetAuthCookie(userName, createPersistentCookie)

createPersistentCookie : true 创建持久性 cookie(跨浏览器 session 保存的 cookie);否则为假。

关于asp.net - .ASPXAUTH cookie 在 session 结束时过期,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12709425/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com