February 25, 2005

Check your variable names: I was coding some ASP to track sessions to see how people surfed through my site (or if they even did) and I used a Session variable to store some information. In the Global.asa file under Session_OnEnd I put in some code and it wasn't working. I left it alone last night and came back to it later today. It turns out that I used different variable names to store the data than to retrieve the data. Same 'contextual' name, just stated in a different manner. So, lesson for the day is 'check your variable names'.
In other news, know that the Response.Redirect directive stops processing your ASP code right then and there, so if there's any code that needs to execute, it needs to be executed before the Redirect. I had incorrectly assumed that Response.Redirect would just write out a redirect to the user, and continue processing the asp file, but I learned that it doesn't when I tried to do a Session.Abandon afterwards, and the Sessions weren't closing out on the server.

No comments: