Originally posted by Prasad Babu:
In my application, user session will be invalidated if user closes window
Actually, no it won't. The server has no idea that you've closed the window. The session will remain valid until it times out or is explicitly invalidated.
But by closing the browser window you can no longer connect to the session. But the session is not invalidated by the act of closing the window.