IHttpSessionState.Abandon 메서드

정의

현재 세션을 종료합니다.

public:
 void Abandon();
public void Abandon ();
abstract member Abandon : unit -> unit
Public Sub Abandon ()

예제

다음 코드 예제에서는 구현 된 Abandon 메서드를 IHttpSessionState 인터페이스입니다. 동작을 복제 하는 코드 예제를 HttpSessionStateContainer 클래스 추가 IsAbandoned 속성으로 설정 된 true 때를 Abandon 메서드가 호출 됩니다. 합니다 IsAbandoned 속성을 검사 하는 동안 세션 상태 모듈에 의해 합니다 ReleaseRequestState 여부 확인 하는 세션이 중단 된 세션 상태 모듈 세션 데이터를 지우고 실행 이벤트는 Session_OnEnd 이벤트입니다.

//
// Abandon marks the session as abandoned. The IsAbandoned property is used by the
// session state module to perform the abandon work during the ReleaseRequestState event.
//
public void Abandon()
{
  pAbandon = true;
}

public bool IsAbandoned
{
  get { return pAbandon; }
}
'
' Abandon marks the session as abandoned. The IsAbandoned property is used by the
' session state module to perform the abandon work during the ReleaseRequestState event.
'
Public Sub Abandon() Implements IHttpSessionState.Abandon
  pAbandon = True
End Sub

Public ReadOnly Property IsAbandoned As Boolean  
  Get
    Return pAbandon
  End Get
End Property

설명

합니다 Abandon 메서드는 세션 데이터를 지울 발생 하는 데 사용 되는 Session_OnEnd ASP.NET 애플리케이션의 Global.asax 파일에 정의 된 이벤트입니다.

적용 대상

추가 정보