What is the best way to show a message to user after session is expired? By then, the user should be logged out and redirected to start page. I can use javascript to redirec
Usually a page will use JavaScript to keep a timer and display a pop-up or dhtml warning a minute or two before the session expires. My bank does this.
It's very annoying though, 'cause if the user has multiple tabs open to the same site, one tab will know the session is about to expire but another tab won't, so you can get the warning even when it's not true. If you try to use an AJAX call to ask the server for a time till the session expires, you've just extended the session timeout and effectively made the session never expire as long as the browser window is open (which may not be a bad thing depending on your specific situation).