Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/csharp/321.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# 表单身份验证请求重新登录_C#_.net - Fatal编程技术网

C# 表单身份验证请求重新登录

C# 表单身份验证请求重新登录,c#,.net,C#,.net,我正在使用 FormsAuthentication.RedirectFromLoginPage(txtUserName.Text, true); 我将“true”设置为持久cookie。但当用户登录时,它会将用户重定向到所需页面 如果用户未注销,请关闭浏览器,然后重新打开浏览器访问URL,然后再次显示登录页面 你知道我在实施过程中遗漏了什么吗 Thanx您正在使用persist=true设置一个永久cookie,而不是会话cookie。在浏览器上检查您的身份验证cookie。那么,如何实现我要

我正在使用

FormsAuthentication.RedirectFromLoginPage(txtUserName.Text, true);
我将“true”设置为持久cookie。但当用户登录时,它会将用户重定向到所需页面

如果用户未注销,请关闭浏览器,然后重新打开浏览器访问URL,然后再次显示登录页面

你知道我在实施过程中遗漏了什么吗


Thanx

您正在使用persist=true设置一个永久cookie,而不是会话cookie。

在浏览器上检查您的身份验证cookie。那么,如何实现我要尝试的操作呢?
FormsAuthentication.RedirectFromLoginPage(txtUserName.Text,false)