Using CheckSession

The CheckSession function is a Microsoft® Outlook Web Access library function that can be called to determine whether the Active Server Pages session is still valid.

If a Web user times out and then tries to refresh the current page, CheckSession determines that the user has indeed timed out—because the Active Server Pages Session object no longer exists. It then requests that the user log in again, providing a dialog box for that purpose (in Web Access, it redirects them to logon.asp). When the Web user logs in again, new MAPI and Active Server Pages sessions are started.

If the Web user logged in anonymously, has timed out, and now refreshes a page, CheckSession logs the person in transparently—that is, without requiring user information. This will also be an anonymous login.

It is good to use CheckSession on every script page.

Note The CheckSession function is defined in the Outlook Web Access file session.inc. To make functions such as CheckSession available for use, you must first include this source file, which you can do in your .ASP file with the following command:

<!--#include file="../lib/session.inc"-->