Microsoft KB Archive/182891

= Session ID does not persist in Active Server Pages =

Article ID: 182891

Article Last Modified on 7/28/2005

-

APPLIES TO


 * Microsoft Active Server Pages 4.0
 * Microsoft Internet Information Server 4.0
 * Microsoft Internet Information Services 5.0

-



This article was previously published under Q182891



SUMMARY
For efficiency Active Server Pages (ASP) maintains a session only when session variables are used. To keep track of a session, ASP sends a cookie to the client. This cookie contains the client's session ID and is used when requesting the session variable from the Web server. When session variables are used, the session is maintained until the session times out or is abandoned.



MORE INFORMATION
One way to see if a session is being maintained is to display the SessionID. To do this, simply create an ASP page that contains the following code:

<% Response.Write( Session.SessionID ) %>

If the value changes every time the page is refreshed, then the session is not being maintained.

Note Because Active Server Pages keeps track of sessions with cookies, the browser must be configured to receive cookies.

