2013-10-27 4 views
0

상자 밖으로 VS 2013 샘플을 테스트 할 때 localhost 또는 localhost에서 액세스 할 때 제대로 작동합니다. 쿠키가 올바르게 생성되어 localhost 도메인에 저장됩니다.OWIN 쿠키 및 IP 주소

그래서 Safari에서 iPad로 테스트를하고 싶었 기 때문에 IISExpress에서 IP 주소 액세스를 사용할 수있게되었습니다. IP 주소 10.0.0.x : port를 통해 테스트 웹 사이트에 액세스 할 때 쿠키가 제공되지 않습니다.

나는 주식 표준 라인이 있습니다

app.UseCookieAuthentication(new CookieAuthenticationOptions 
    { 
     AuthenticationType = DefaultAuthenticationTypes.ApplicationCookie, 
     LoginPath = new PathString("/Account/Login") 
    }); 

내가 "이름"MS 신원 내 쿠키에 관계없이 브라우저 도메인 이름 "localhost"를 "IP"또는 "XXXX"너무 사용할 수있는 방법을 그 여전히 작동할까요?

답변

1

처음에는 이것이 작동하지 않는 이유가 확실하지 않습니다. 나는 아직도 이것으로 놀고있다.

app.UseCookieAuthentication(new CookieAuthenticationOptions 
{ 
     AuthenticationType = "ABC", 
     LoginPath = new PathString("/Account/Login"), 
     CookieName = "ABC" 
    }); 

을 그리고 난 후 로그인 절차 (IdentityModels.cs)에 다음 줄을 수정

var identity = manager.CreateIdentity(user, "ABC"); 

그리고 일을 시작 :하지만 난 (Startup.Auth.cs에서)에 시작 쿠키 설정을 변경했습니다.