Developing Web Applications |
Redirection during the Session_OnStart event is possible, and sometimes required by your application (see the sidebar Web Clusters and ASP Session State). Here is an example:
Sub Session_OnStart
Response.Redirect "MyStartPage.asp"
End Sub
Not all of the Response object’s methods are available during the Session_OnStart event. Most notably, you cannot use the Write method to display messages, since the client would never see them. However, you can redirect to an error message, if your application cannot successfully initialize a new user session.