?
Solved

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

Posted on 2004-09-13
8
Medium Priority
?
4,073 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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 500 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

Want to be a Web Developer? Get Certified Today!

Enroll in the Certified Web Development Professional course package to learn HTML, Javascript, and PHP. Build a solid foundation to work toward your dream job!

Question has a verified solution.

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

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…
Have you ever needed to get an ASP script to wait for a while? I have, just to let something else happen. Or in my case, to allow other stuff to happen while I was murdering my MySQL database with an update. The Original Issue This was written…
Michael from AdRem Software explains how to view the most utilized and worst performing nodes in your network, by accessing the Top Charts view in NetCrunch network monitor (https://www.adremsoft.com/). Top Charts is a view in which you can set seve…
In this video, Percona Director of Solution Engineering Jon Tobin discusses the function and features of Percona Server for MongoDB. How Percona can help Percona can help you determine if Percona Server for MongoDB is the right solution for …

752 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