Solved

IIS log failed to write entry, File //global.asa

Posted on 2004-09-13
8
3,908 Views
Last Modified: 2008-01-09
Hi,

I recently started getting this error in my Application event log a couple of days ago and I have no idea what it is about?  This website has been up for a coupel of years now and this only started coming up now.  I was doing some changes on my ASP website  but it's not anything major?

The error is:
Warning: IIS log failed to write entry, File //global.asa Line 53 Object required: 'Session'. .


Please note the line number changes around--I don't know why either, but it always points to some session variable.

Here is a portion of my global.asa file:
(this is line 21) Sub Session_OnStart()
      '==================================================================================
      '===============================SECURITY===========================================
      '==================================================================================
      Session("VALIDATED") = false
      Session("CUSTOMER_ID") = ""
      Session("NEW_CUSTOMER") = ""
      Session("SHOW_ACTIVE") = true
      
      '==================================================================================
      '===============================SHOPPING CART======================================
      '==================================================================================
      CONST CART_COLUMNS = 3
      'COL      DESCRIPTION
      '0            order number
      '1            quantity
      '2            type: software=0 or hardware=1
      Dim cart_array( ) ' <<<< notice no size!
      ReDim cart_array( CART_COLUMNS, 10 ) ' an arbitrary initial size
      cart_max_used = 0 ' no elements used yet...
      
      Session("CART_ARRAY") = cart_array
      Session("CART_MAX_USED") = cart_max_used
      
      Session("SHIP_TO_ZIP_CODE") = ""
      Session("SHIP_TO_TOTAL") = ""
      Session("SHIP_TO_METHOD") = ""
      Session("MESSAGE") = "Enter your shipping address zip code and select a shipping method"
      
      Session("ORDER_TAX") = ""
      Session("ORDER_SHIPPING") = ""
End Sub

Sub Session_OnEnd()
      Set Session("CART_ARRAY") = nothing
      Set Session("CART_MAX_USED") = 0
      Set Session("VALIDATED") = nothing
      Set Session("CUSTOMER_ID") = ""
End Sub


I don't think the error is affecting the website --- but any ideas as to how to make this go away....or why it is popping up.......would be wonderful.

Thank you for your help!!!   :-)
0
Comment
Question by:zoomeroo
8 Comments
 
LVL 46

Expert Comment

by:fritz_the_blank
Comment Utility
You might want to keep track of the line numbers to see if the error always falls within the Session_OnEnd.

It is notoriously flaky and frequently fails to fire properly at all. It could very well be that your log is catching those instances of the Session_OnEnd misbehaving.

That is one reason why I never use it.

FtB
0
 

Author Comment

by:zoomeroo
Comment Utility
Thanks for your quick response.

It happens in session_onstart too.

If no one knows why/what is going on, can anyone suggest any workarounds? (though the mystery is tormenting me :-)  )

Thanks!
0
 
LVL 6

Expert Comment

by:Leviter
Comment Utility
Weird problem.... does it have to do with lack of diskspace?
0
 
LVL 11

Accepted Solution

by:
coopzz earned 125 total points
Comment Utility
>>Sub Session_OnEnd()
>>     Set Session("CART_ARRAY") = nothing
>>     Set Session("CART_MAX_USED") = 0
>>     Set Session("VALIDATED") = nothing
>>     Set Session("CUSTOMER_ID") = ""
>>End Sub

I think you'll find that you can't    """set""" a contents value to 0 you can make it  """="" 0 thought.\
ie:  Set Session("CART_MAX_USED") = 0   XX wrong Object required: 'Session... [this isn't an object]
      Session("CART_MAX_USED") = 0 Correct

But just to clarify when that sub runs anyway it's when the session object get's destroyed ie: no more data so you don't need to make things equal nothing and stuff cause it's all about to be reclaimed.

cheers..
0
 
LVL 12

Expert Comment

by:GoofyDawg
Comment Utility
Extending on what coopzz said, session variables are as the name implies: Variables. They're storage elements. When using SET, what you're doing is changing an object reference. For instance set rs = conn.Execute(sql) means make this object "rs" _refer_ to the recordset that's returned from the query executed by the object "conn." In your case, especially where you're setting a session var to nothing, you're saying make this object refer to nothing. But since you're not dealing with an object in the first place, you're getting an error. In any case, all you're trying to accomplish is resetting vars in your OnEnd. However, since everything you're trying to reset is a var, just let them go, and their memory space will be reclaimed as coopzz said above.

GoofyDawg
0

Featured Post

Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

I was asked about the differences between classic ASP and ASP.NET, so let me put them down here, for reference: Let's make the introductions... Classic ASP was launched by Microsoft in 1998 and dynamically generate web pages upon user interact…
This demonstration started out as a follow up to some recently posted questions on the subject of logging in: http://www.experts-exchange.com/Programming/Languages/Scripting/JavaScript/Q_28634665.html and http://www.experts-exchange.com/Programming/…
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…
This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're looking for how to monitor bandwidth using netflow or packet s…

771 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now