재우니의 블로그


http://www.vikramlakhotia.com/A_few_interesting_things_about_session_in_AspNet.aspx

If we have the session state enabled and we do not store anything in the session then the session Id will change every time a new request is made. This also means that a new session is created every time. But the sate is never saved as there is nothing to save. Note the session_Start event will not fire for every request. The session_start event will only fire once.

session state 가 enabled 일 경우, session 에 어떤 것도 저장하지 않는다. 그리고 session Id 는 새롭게 호출될때 마다 매번 변경될 것이다. 그러나 상태도 어떤것도 저장하지 않기에 절대 저장하지 않는다. 주목할 것은 session_state 이벤트는 매번 요청이 발생되지 않는다. session_start 이벤트는 꼭 한번 발생된다.

Another interesting stuff about session Id is that it does not changes after we have called the Session.Abondon() method or when the session times out. Even though Session State expires but the session ID remains same. The session Id will last as long as the browser session does.

session Id 의 또 다른 흥미로운 부분은 Session.Abondon() 메소드 호출 후 및 session time 이 out 될 때 변경되지 않는다는 점이다. 비록 Session State 이 expire 가 되었을지라도 session ID 는 동일하게 남아 있다. session Id 는 브라우저 session 있는 한 오랫동안 지속될 것이다.

Session Class has two methods. Session.Abondon() and Session.Clear(). Both the methods are used to clear the data in the session. But there is one difference between them. If we use Session.Abondon() then Session_end event will be fired and session_start event will be fired on the next request. The same is not true for session.Clear() method.


Session 클래스는 두 개의 메소드들을 가지고 있다. Session.Abondon() 와 Session.Clear() 이 그것이다. 이 메소드 둘 다 session 에서 데이터를 clear 할 때 사용된다.  그러나 이 둘 사이에 다른 점이 하나 있다. 만약에 Session.Abondon() 을 사용하면 Session_end 이벤트가 발생될 것이며, session_start 이벤트도 다음 요청시에 발생될 것이다. 하지만 session.Clear() 메소드는 그렇지 못하다.