• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 4255
  • Last Modified:

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

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
zoomeroo
Asked:
zoomeroo
1 Solution
 
fritz_the_blankCommented:
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
 
zoomerooAuthor Commented:
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
 
LeviterCommented:
Weird problem.... does it have to do with lack of diskspace?
0
 
coopzzCommented:
>>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
 
GoofyDawgCommented:
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
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Cloud Class® Course: Microsoft Windows 7 Basic

This introductory course to Windows 7 environment will teach you about working with the Windows operating system. You will learn about basic functions including start menu; the desktop; managing files, folders, and libraries.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now