Discussion Locked

intermittent session object?

0 helpful
2 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.

I'm experiencing an issue with a web application. When a user logs in we set in the Login.asp page:
session("session_username")=strUser //strUser is from the login text box and is enterprise ID
session("session_personnel_ID")=personnelNum //personnellNum is the users personnel number from Active Directory.
On all of our pages is a #include file, readCookie.vbs:
<%
On Error Resume Next
if (session("session_personnel_ID")="") then
Response.write ""
end if
%>

And in the Global.asa file I have:
Sub Session_OnStart
Session.timeout=45
End Sub

An intermittent problem is occurring. Whenever a user navigates to a new page within the application they sometimes get redirected to the Login.asp page. When I comment out the readCookie.vbs file the problem does not occur. This is relatively recent, as near as I can tell it started about a week ago. I set some debug statements in the code and there is no pattern as to when this occurs. The same page can be hit several times in a row and then bang -- back to Login.asp. Or it won't happen at all for several hits.
Do you know of any reason why this could be happening? Is the Session object being destroyed for some reason?

2 replies

by bojidar alexandrov

As you describe problem it seems too strange. May be teh problem is on server.
On Win2000 if IIS 5 crashes it is restarted and application and sessions will be reset.
Another thing for the code:
When your function from include is executed it willcontinue with remaining from current file. It will be better to put
"Response.End" right before "End If"
Checking session("session_personnel_ID")="" is not too good - NULL <> "". Instead Len(session("session_personnel_ID"))=0 is better.
Using client side VBScript is not good because only IE supports it. Javascript client side code will be window.open ('Login.asp', '_top');

This discussion is closed to new replies.