Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

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

Posted on 2004-09-13
8
Medium Priority
?
4,114 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

New feature and membership benefit!

New feature! Upgrade and increase expert visibility of your issues with Priority Questions.

Question has a verified solution.

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

I would like to start this tip/trick by saying Thank You, to all who said that this could not be done, as it forced me to make sure that it could be accomplished. :) To start, I want to make sure everyone understands the importance of utilizing p…
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…
Sometimes it takes a new vantage point, apart from our everyday security practices, to truly see our Active Directory (AD) vulnerabilities. We get used to implementing the same techniques and checking the same areas for a breach. This pattern can re…
Please read the paragraph below before following the instructions in the video — there are important caveats in the paragraph that I did not mention in the video. If your PaperPort 12 or PaperPort 14 is failing to start, or crashing, or hanging, …

618 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