File: D:/web/asptest/global.asa
<SCRIPT LANGUAGE=VBScript RUNAT=Server>
' (SS,14/9/07) New version
' (SS,21/11/07) The Session_OnEnd had stopped working after Windows 2003 SP2. Worked after hotfix.
' Moved some code into Session_AddBackToStock
Sub Application_OnStart
Application("ConnectionString") = "DSN=MySQL_galleon;"
End Sub
Sub Application_OnEnd
End Sub
Sub Session_OnStart
Session.Timeout = 180 ' time out after three hours of non-use
' Set the server locale to UK, mainly to prevent date problems (day and month being reversed)
Session.LCID = 2057
' make sure basket is empty on session start
Session_EmptyBasket
' clear the session values
' following are used for continue shopping and search log
Session("Search") = ""
Session("Page") = ""
Session("Category") = ""
Session("Subcategory") = ""
' following are check out values accepted from user
Session("Title") = ""
Session("FirstName") = ""
Session("Surname") = ""
Session("Address1") = ""
Session("Address2") = ""
Session("Town") = ""
Session("County") = ""
Session("Postcode") = ""
Session("Country") = ""
Session("Telephone") = ""
Session("Email") = ""
Session("EmailConfirm") = ""
Session("PurchaseOrderNo") = ""
Session("Message") = ""
' (SS,16/7/04) delivery address same as invoice set to true
Session("DeliveryAddressSameAsInvoice") = True
' when order created this holds the order number used
Session("OrderNoPlaced") = ""
' (SS,11/5/04) used to save selected categories in menu
Session("MenuCategory") = ""
Session("MenuSubcategory") = ""
' (SS,18/5/04) to allow password protection during development stage '
' used in conjunction with Application("DevelopmentPassword") '
Session("Authenticated") = False
' (SS,20/5/04) following used to keep track of which special offers to show next '
Session("SpecialOfferCount") = 0
' (SS,3/8/04) account holder settings
Session("AccountID") = "" ' this is blank if account ID not entered and authenticated '
Session("ContractID") = ""
' (SS,30/9/04) added referrer feature '
Session("ReferrerAdded") = False
End Sub
Sub Session_OnEnd
' add items in order taken from stock back into stock
' (SS,21/11/07) OrderNo passed as parameter, more reliable using Session("OrderNoPlaced") in subroutine doesn't always return correct value
Session_AddBackToStock(Session("OrderNoPlaced"))
' empty the basket when session has timed out or ended some other way
Session_EmptyBasket
End Sub
Sub Session_EmptyBasket
' delete the shopping basket
End Sub
Sub Session_AddBackToStock(AOrderNo)
End Sub
' (SS,20/11/07) used for debugging
Sub AddLog(AMessage)
End Sub
</SCRIPT>