Global.asa :: Session_OnStart And Application On Start Both Not Working
In Global.asa I have mentioned two sub routines 1> Session_OnStart and 2>Application on Start but both of them are not at all initiated when I restart IIS.
Please Tell me why is this happening, I have tried ever ....
my understanding was when IIS restarts that time when the first session is requested application_on Start is called. My session time out is 1 minute. after every session time out happens when the session is requested then it goes to application_onStart first. Isn't application on start just happens only when IIS restarts and first session requested.
The "Session_OnStart" event doesnot fire if the website has .htm file as the startup document. If I change the extension of the default document from ..htm to .asp then I can see the event fires, But now I cant change the default page to .asp.
How can I make the Session_OnStart fire in that situation?
Do I need to do a Application_onstart first then i can do Session_onstart?? or it doesnt matter which one is used b4 which one? When i use a global.asa, do i need to call it within my asp page to execute it or will it be auto started and execute?
i just started learning what it can do, and I am using it to tracj how many people have logged into my site, but when people login to my site, I start 2 sessions, one for their ID, and one for their name. Is there any way to only count the name session as a session_onstart in global.asa?
I have one IIS 6 machine that seems to ignore global.asa completely. I can't get *anything* to fire -- not Session_OnStart(), not typelib declarations. This is true in the web root as well as in any application folder.
In particular, this is preventing me from loading the ADO 2.8 type library,but I cannot even force an error by using a malformed GUID.This is my only machine that appears to have this problem.
In my Session_OnStart in Global.asa, I am setting some cookies. One of them, I set as follows:
dim UserID UserID = Request.ServerVariables("LOGON_USER") Response.Cookies("User")("ID") = UCASE(UserID)
When I immediately log the cookie value retrieved from Request.Cookies("User")("ID") into the Windows Event Log, I get the correct value. However, when I try to retrieve the cookie on the home page of my application using the same code,
Request.Cookies("User")("ID"), it either cannot find the cookie or cannot read the value. I am retrieving the cookie before all HTML headers are written. It is my first statement on the page after Option Explicit. I have even compared the session IDs. The SessionID created in the Session_OnStart is the same value as the SessionID on the home page.
I have read that the Session_OnStart only has access to the Application, Session and Request objects. It does not explicitly say that it does not have access to the Response object. Also, I was even able to use Response.Write's in Global.asa to print out the values although it looked like it had also stopped the session after I did so. Cookies are definitely enabled on my machine. I have even tried setting the session cookie's expiration to be persistent for a few days to see if it was perhaps expiring before I was able to read it but this did not work either.
Is there something preventing cookies to be created in Global.asa in the Session_OnStart sub? Is the Response object not available??? Please let me know if anyone else has had this problem or solution.
I have one application folder containing all ASP code files. I want host multiple sites pointing to same code. Can I do this ? If YES then how I can assign diffrent global.asa to each application...
This is a standard ASP application that has several pages at the root withthe global.asa. I set a session variable session("accountid") = "123456" within an asp page and then response.redirect to the next page and immediately response.write session("accountid") and I get back nothing.
But if I set a session variable session("accountid") = "123456" within an asp page and response.redirect to a page in a sub directory and immediately response.write session("accountid") I get back 123456 on the screen.
I put the following in the global.asa which is on the root of the web at the top of the asa file:
<!--METADATA TYPE="typelib" UUID="EF53050B-882E-4776-B643-EDA472E8E3F2" NAME="ActiveX Data Objects 2.7 Library" -->
It's not working. I put the following in an ASP located in a folder which is an application folder but not a Virtual Directory and is an immediate child of the root of the web.
<!--METADATA TYPE="typelib" UUID="EF53050B-882E-4776-B643-EDA472E8E3F2" NAME="ActiveX Data Objects 2.7 Library" -->
It works.
The test is:
<% Response.Write adOpenDynamic %>
Can someone explain what I am doing wrong here? I thought it did work at one time. Do I need to put a global.asa in this application folder? I thought there was a bubbling-up or trickle-down of the global.asa not sure what it is called.
I have just started developing a shopping site and I have a problem.I am using Win XP Pro's IIS to test my asp pages.I couldn't see global.asa in root directory and put it there
On session start I set the session("test")="test" to test if global.asa is working however as I run the asp page I couldn't see the test written on page
Why global.asa is not working?Isn't Win XP Pro a good platform to test the asp pages?
i have iis on my comp. the global.asa file works for one folder while it does not for another. And when i uploaded the file that works onto my web hosting company's server, it does not work. the global.asa file that works on my comp does not work on the www.
My global.asa is not working. Iam using win xp and visual studio 2003 to develop the application.I just wonder why. The copy of the global.asa copy to another application is worked fined.
I still have no clear idea of Application_OnEnd functioning on w2000 both Pro and Server. I have this sub in my global.asa which is supposed to save Application scope variables to a file. (then Application_OnStart will restore theses variables from the file)
It worked fine on local w98/PWS and on ISP NT4-Server/IIS4 To initiate Application_OnEnd and Application_OnStart for test purposes it was sufficient to re-upload global.asa Also Application_OnEnd were fired and registered by global.asa when shutting Windows down in a proper way.
On w2000 re-uploading global.asa does not trigger Application_OnEnd.Nevertheless it does trigger Application_OnStart Neither does Application_OnEnd work on shutting W2K down Is it a known behavour or I am having some anomaly? Perhaps w2k need a different syntax for Application_OnEnd?
I have absolutely no idea how global.asa works. I've read through quite a number of articles and they're all fine and dandy but implementing it on my (first) ASP application just doesn't work. It's amazing how ASP.NET automates everything for you.
Anyway, I need to store session variables and I have no idea how to. I have no global.asa file, but I can declare session variables fine. So does that mean that somewhere in the ASP process, a Session_OnStart() method's already running.
If I create a global.asa file, I put it in the same directory with other ASP files right?
A global.asa file should contain the basic four application/session methods... and shouldn't really contain much code, unless I want to start a variable with a default value. True or false (I say true). Code:
Until now I've only seen VBScript to handle application and session events (e.g. Application_OnStart, Session_OnStart). Is it possible to do this directly in JavaScript or do I have to write VBScript proxies?
I'm just dipping my toes into server-side scripting.
The Global.asa file seemed really nice, but am I understanding correctly that the application onstart event is fired ONLY when the server is started/re-started or when the FIRST user logs onto an ASP application?
If that's the case, then all the changes I keep making to my Global.asa file are pretty useless, right? (which seems to be the case -- i.e., my pages are not using any of the new information). Code:
When I set a cookie in global.asa in the sub session_onstart, even if I have "privacy" in IE 6.X set to "block all cookies" the cookie is still set, and I can get it on other pages.
I can't find an article that addresses this as a specific issue. Why does the browser get the cookie when it is set in the session_onstart event even when I have "block all cookies" set?
I have a SQL database, which runs a basic search engine, it has about 3000 links at the moment. I am currently keeping track of the click through rate and displaying in, below the link so it says HITS TODAY / HITS TOTAL. What I would like to do now is to take it one start further and be able to offer people the opportuntiy to have a small piece of code in their site, that will be able to update another hits counter in my SQL server. I obviously dont want to allow people to my SQL or open the 3306 port to the public, I would just like to be able to load a small java / vbs or what ever, to be able to write to my SQL.. I use http://www.counted.com/ at the moment, but I want to be able to do just very basic hit counter, I think from looking at how other people seem to do it, I might need to do this using Java Script
I have a Hello World app written in VS2003 C# it runs fine on my local PC using IIS5 XP Pro Dotnet1.1 but when I up load it to my site I get the following:
Server Error in '/' Application. --------------------------------------------------------------------------------
Parser Error Description: An error occurred during the parsing of a resource required to service this request. Please review the following specific parse error details and modify your source file appropriately.
Parser Error Message: Could not load type 'WebApplication1.WebForm1'.
Recently my IIS link in admin tools will not open the iis control panel. I have been doing asp development on the machine for some time so it seems odd this problem has all of a suden happened. I read somewhere a file (iis.mcs?)could be corrupt? Does anyone know how to fix it?I ask this place 'cos I am thinking that someone using ASP too also has had a similar problem or can point me in the right direction.
How do i require ONLY 443 on one site and ONLY 80 on the other. The secure portion does not use Host headers. I have 2 websites on the same machine
SSL.MyMachine.com Normal.MyMachine.com
I want the guy who hits SSL.MyMachine.com to only be able to use port 443 and never port 80. I want the guy who hits Normal.MyMachine.com to only be able to use port 80 and never port 443. How do i require ONLY 443 on one site and ONLY 80 on the other. Becuase the secure portion does not use Host headers.
We have a link to an ecommernce page, it uses sessions (which we do not have access to change)
I want to create a popup window that will create a new Internet Explorer browser to open (at a page i specify). I dont mean like the javascript where it just opens a window and contains all the info that u have (same as if you hit ctl-n) I mean lauching Internet Explorer new again, going to this specific site to aviod the session that it is already in?
I know something about HTML and no more but recently i really like to learn ASP but unfortunatly no body know ASP here. How can start asp and what should i know before i start learning ASP.