Session handling features can be provided in your Page Template by –
- Overriding the OnLoad() method in your Page Template class.
- In the OnLoad() method, do all session checks - e.g. check if user ID is available in the session.
- If not, then redirect to an error page if the current page is not one of the three
- The first page of your site
- The page responsible for setting session variables.
- The Error page
- Developers need not write repetitive code like validating the user’s session, redirecting incase of timeout/invalid user.