2011-12-07 2 views
1

는 매개 변수가 :어떻게하면 sessionState 티켓을 찾을 수 있습니까? Web.config의에서

<authentication mode="Forms"> 
    <forms timeout="50"/> 
</authentication> 

이 코드에 의해 남아있는 시간을 찾을 수 있습니다

if (Page.User.Identity.IsAuthenticated) 
    { 
     FormsIdentity id = (FormsIdentity)Page.User.Identity; 
     FormsAuthenticationTicket ticket = id.Ticket; 
    } 

와의 web.config에서

가 :

<sessionState timeout="50"/> 

나는 sessionState 기간의 티켓을 찾을 수 있습니까?

답변

1

당신은 프로그래밍 방식으로는 50를 반환합니다

int timeout = HttpContext.Current.Session.Timeout; 
+0

와 클래스 내부

int timeout = Session.Timeout; 

또는에서 파일 뒤에 코드에서 세션 시간 제한을 찾을 수 있습니까? – Wachburn

+0

예, 50을 반환합니다. –

관련 문제