Asp.net OWIN Cookies和IP地址
当我在VS 2013中测试这些示例时,它们与localhost或从localhost访问时工作良好-cookie生成良好并保存在域localhost中 然后我想在Safari上用iPad做一些测试,所以我在IISExpress上启用了IP地址访问。当我通过IP地址10.0.0.x:port访问我的测试网站时,没有提供cookie 我有股票标准行:Asp.net OWIN Cookies和IP地址,asp.net,owin,asp.net-identity,Asp.net,Owin,Asp.net Identity,当我在VS 2013中测试这些示例时,它们与localhost或从localhost访问时工作良好-cookie生成良好并保存在域localhost中 然后我想在Safari上用iPad做一些测试,所以我在IISExpress上启用了IP地址访问。当我通过IP地址10.0.0.x:port访问我的测试网站时,没有提供cookie 我有股票标准行: app.UseCookieAuthentication(new CookieAuthenticationOptions {
app.UseCookieAuthentication(new CookieAuthenticationOptions
{
AuthenticationType = DefaultAuthenticationTypes.ApplicationCookie,
LoginPath = new PathString("/Account/Login")
});
我如何“命名”我的cookie以供MS Identity使用,以便无论浏览器域名“localhost”“IP”或“XXXX”如何,它都能正常工作?我不确定为什么最初无法正常工作。我还在玩这个。但是我将启动cookie配置更改为(在startup.Auth.cs中): 然后我修改了SignIn(IdentityModels.cs)中的以下行 它开始工作了
app.UseCookieAuthentication(new CookieAuthenticationOptions
{
AuthenticationType = "ABC",
LoginPath = new PathString("/Account/Login"),
CookieName = "ABC"
});
var identity = manager.CreateIdentity(user, "ABC");