다음을 통해 공유


IHttpSessionState.Abandon 메서드

정의

현재 세션을 종료합니다.

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

예제

다음 코드 예제에서는 인터페이스의 Abandon 메서드를 구현합니다 IHttpSessionState . 코드 예제에서는 메서드가 호출 될 때 설정 true 된 속성을 추가 IsAbandoned 하는 클래스의 HttpSessionStateContainer 동작을 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 메서드는 세션 데이터를 지우고 ASP.NET 애플리케이션에 대한 Global.asax 파일에 정의된 Session_OnEnd 이벤트를 발생하는 데 사용됩니다.

적용 대상

추가 정보