Solved

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

Posted on 2004-09-13
8
3,994 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
ID: 12050562
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
ID: 12051074
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
ID: 12051713
Weird problem.... does it have to do with lack of diskspace?
0
 
LVL 11

Accepted Solution

by:
coopzz earned 125 total points
ID: 12052052
>>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
ID: 12052207
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 Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I have helped a lot of people on EE with their coding sources and have enjoyed near about every minute of it. Sometimes it can get a little tedious but it is always a challenge and the one thing that I always say is:  The Exchange of information …
Hello, all! I just recently started using Microsoft's IIS 7.5 within Windows 7, as I just downloaded and installed the 90 day trial of Windows 7. (Got to love Microsoft for allowing 90 days) The main reason for downloading and testing Windows 7 is t…
Microsoft Active Directory, the widely used IT infrastructure, is known for its high risk of credential theft. The best way to test your Active Directory’s vulnerabilities to pass-the-ticket, pass-the-hash, privilege escalation, and malware attacks …
In an interesting question (https://www.experts-exchange.com/questions/29008360/) here at Experts Exchange, a member asked how to split a single image into multiple images. The primary usage for this is to place many photographs on a flatbed scanner…

840 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