The thing to understand is that a server side session is not the same thing as a browser session. By default the IIS session timeout is 20 minutes, so 20 minutes of no activity and the session expires and the next activity from the same user/browser will start a new session. A browser session is determined by when the browser is closed or restarted, so if the browser is left open the server side session may timeout but its still an active browser session. Note that you can close a web site but the browser session is still active if you visit the site again without closing the browser, only closing the browser expires a session cookie.
This article Add a Notification Bar to Your Web Site Using jQuery by Bipin Joshi should help you.
Hope that helps,