如何使用2个Cookie进行身份验证?

时间:2018-09-21 08:28:39

标签: c# authentication cookies asp.net-core

我有2台设备,个人电脑和特殊的平板电脑。我想使用同一应用程序.net core 2.0 2个cookie或具有2个auth cookie的cookie方案,因为对于PC,我想在5分钟后过期,而该特殊平板电脑则完全不过期。怎么做。现在我有了这个...

app.UseCookieAuthentication(new CookieAuthenticationOptions
            {
                AuthenticationScheme = "myScheme",
                ExpireTimeSpan = TimeSpan.FromSeconds(300),
                CookiePath = "/",
                CookieSecure = env.IsDevelopment() ? CookieSecurePolicy.SameAsRequest : CookieSecurePolicy.Always
            });

我想我可以使用UseWhen方法,或者我不知道...

还是要登录其他Cookie?

1 个答案:

答案 0 :(得分:0)

选中Using cookie authentication without ASP.NET Core Identity

$wmi = Get-WmiObject -Class Win32_NetworkAdapter -filter "Name LIKE '%Wireless%'"
$wmi.disable()