| This Chapter | |
| - | Chapter 20: Early HttpSession Invalidation |
| - | HttpSession Invalidation in Struts |
| - | Early HttpSession Invalidation |
| - | Summary |
HttpSession objects are useful, however they also consume memory. Therefore, when an HttpSession object is no longer needed, it should be destroyed by calling its invalidate method. Many programmers provide a link for users to log out, but few use it. Often, they simply close the browse when they are done with an application. Waiting for HttpSession objects to die naturally will cause more memory to be used longer that it needs be. This chapter discusses a technique that forces HttpSession invalidation when the browser is closed.