Session-global.asa
where do you have to place your global.asa file in order for your session variables to work? If i dont have access to the root (not my server, a remote one), is there any way i can specify a path to my global.asa?
View Replieswhere do you have to place your global.asa file in order for your session variables to work? If i dont have access to the root (not my server, a remote one), is there any way i can specify a path to my global.asa?
View RepliesI'm trying to add a "user-verifacation" thingy to my site.
my problem is using/accessing session variables.
all the tutorials say that the global.asa should only have
the script tags (<script...> & </script>) and inside the script itself
only have the application/session onstart/end.
I've created this global.asa file and put it in my site-root folder:
<script type="text/javascript" language="javascript" runat=server>
function Session_OnStart()
{ Session("LoggedIn") = "NO"
}
</script>
but i can't access the session variable Session("LoggedIn")... from any page.
I have started session("visitorID") in global.asa in order
to keep track of how many users are on our site at any
given time, trouble is I can't seem to call the session
while on another page.
As I am relatively new to asp I'll post both the setting
of the session and the call to it on the other page below Code:
i have a logon page, i create session variables for every person who logs on, but when their session times out, i want to redirect them (or have a popup window) that tells them that they have been logged off, but i have no success.' global.asa:
<script language="vbscript" runat="server">
Sub Session_OnEnd
Response.Redirect "loggedout.asp"
End Sub
</script>
but it doesnt work, i set the timeout to 1 minute, and i lose the session variables, but i cant seem to redirect them to the loggedout page!
I have a application which is a global login for other applications. Basically application A checks all the user login information and then lists all the applications B-Z that the user has access to.
I have a global.asa file in application A and individual global.asa files in applications B-Z. Applications B-Z are under the Application A directory. Can I have global.asa files in each of the application folders? Does the pages look for the closest global.asa file?
I have to keep track of user login time and logout tme for each application. The problem I run into is how do I record the user logout time when the session expires?
CAn I set a session variable dynamically based on a value in a database and use the global.asa to do it...
View Replies View RelatedAll, Just to give a little background this is reagarding an ASP 3.0
application running on IIS6 using the default app pool.
I have set the session timeout to 540 minutes in IIS (under options tab in
Application configuration). There is no code in the Session_OnStart or
Session_OnEnd in the global.asa. Via an include file, each page executes
these no-cache related code:
Response.Buffer = True
Response.ExpiresAbsolute = Now() - 1
Response.Expires = 0
Response.CacheControl = "no-cache"
Response.CacheControl = "private"
Sorry, just wanted to give some background on what we're dealing with.
Anyways, the problem is that the users are saying their session state is
expiring much sooner than 540 minutes. How is this possible? What did I miss?
Are there better techniques to ensure the 540 minute session?
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?
View Replies View RelatedCan I put a session.timeout = "45" in the global.asa file? and if yes, under what section?
View Replies View RelatedI'm using the following code in my global.asa file to set the
session.timeout value amongst other things -
Sub Session_OnStart
Session.Timeout = 40
Session("Authenticated") = 1
End Sub
Yet when I print out the value of session.timeout on a page after this
event has fired it returns 20 (I get the right value for
Session("Authenticated") so my code appears to be working).
I checked the default timeout value in IIS (v5) on the server, but
this reads 900 seconds, which in my books is 15 minutes. I am
therefore very confused as to where this value of 20 is coming from.
Could anyone point me in the right direction as I need to set this to
40 minutes and my WROX manual doesn't provide much information on this
property.
I need to set a session time out for this website that was created by someone else using ePower. How can I configure the global.asa page to set a time out session for the users or do I have to set this in IIS? Code:
View Replies View RelatedI 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:
I am trying to run a Session_OnStart Script based on a Session variable that is created on a .asp page. The problem is that when I reference the Session in Global.asa It has no value but it has a value on the .asp page level. Is there a certain way that I have to reference a Session in Global.asa?
What I have is somthing like the following:
Sub Session_OnStart
If Session("NIS")<> "" Then
Run The Routine
End If
End Sub
Based on the above the routine does not run because Global.asa does not seem to get the value of Session("NIS").
I have initialized some session variables in Global.asa for our web
application. But these session variables are returning null values; it is was
working fine before; Recently we have rebuild our servers.
Please let me know if anyone of you have some idea?
I am trying to write a sub that will delete a spreadsheet file created by the web user. THis is the code I have inserted into the global.asa file, but it is not working.
sub Session_OnEnd
'delete the temporary excel spreadsheet
Set objFSO = Server.CreateObject("Scripting.FileSystemObject")
objFSO.DeleteFile(Server.mappath("temp/<%=session.sessionid%>.xls"))
Set objFSO = Nothing
end sub
I have made sure that the temp folder has permissions set for the IUSR_machinename account to be able to delete files. I am running IIS 5 on a windows 2000 server.
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?
Can I implement session without global.asa file in my root directory....and is there any good site for sessions tutorial.
View Replies View RelatedWhat i'm trying to do is delete away some rows of data in a database when a session ends. The codes are shown below. The problem is why the the database dont get deleted even after i set the timeout to 1 (waited for more than 1 minute) or after the script called the Session.Abandon? Code:
View Replies View Relatedi want to increase my session time so that it does not expire till the user closes the site.
i have written in global.asa file the following code:
<SCRIPT LANGUAGE="VBScript" RUNAT="Server">
Sub Session_OnStart
Session.Timeout = -1
End Sub
</script>
but it doesnt work and my sesion still expires.
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...
View Replies View RelatedI have added a db driven marquee to my site and need to combine the global asa's to 1 global asa file. Code: ......
View Replies View Relatedhow to find the session expired or not without using any session varaibles?
View Replies View RelatedI am trying to put a condition in my Global.asa file based on the server
name.the reason, I want to set a global string as a application variable based on
the server I am on.
I also need to set a coonection string based on the value of the server.
I need to use this connection string to retrieve values from an sp in
application on start that sets a load of global variables so I can't really
do this anywhere else.
I have a site which until this morning, was on a remote server. The structure was that the "site" was actually a folder on the server, as I am designer and use this arrangement to develop sites. Under the root directory, I had modified the global asa file to include session variables. Ok, so I download the site (folder) to my hard drive, and put it in the folder of "MY Documents" called MyWebs. I then opened VB Studio and created a new solution, which is pointing to the before mentioned directory in My Documents. When I pull the site up in IE, the session variables were not being called, and I realized I had not copied over the asa file. So I did so, placing a copy of it in the hard drive's c inetpub wwwroot directory, and also directly in the my docs mywebs directory,and the site's directory as well. It seems it is still not being called.Can anyone tell me what I am doing wrong?
View Replies View RelatedIs the Global.asa file resolved before parsing the 'Include' (files) or
after parsing the 'Include' (files)?
I have IIS 5.0 installed on for a test server. the global.asa file runs perfectly.
when tryng the same application on win server 2003 IIS 6.0 the global.asa does not fire. i have set the application as a virtual site and given rights for iwam and iusr. What else could be the problem. Code:
How does IIS 6.0 treat the global.asa file? I had the following problem;
1. uploaded a new site to the win3k server
2. had incorrect db connection string in Session_OnStart in global.asa and website caused errors.
3. Changed the global.asa file to include the correct details. Saved the file. Still got the same errors.
I could not resolve this unless restarting the WWW Service on this server. In IIS 5.0 the global.asa file would reload after resaving it (as the timestamp is updated).
I even waited the next day before restarting the service because I though Session_OnStart expires after my session ends...but the error was still there
in the morning.
Hopefully someone will make sense of it for me. Here is the code (I inherited) in the global.asa
Sub Application_OnStart
Application("DB.ConnectionString")= ""
Application("MaxLoginAttempts") = 5
Set Application("Con") = Server.CreateObject("ADODB.Connection")
Session("Test") = Now()
End Sub
Sub Session_OnStart....
Is it possible to use ADO in global.asa?I simply want to creat a log of each visit to the site?
View Replies View RelatedI created a dll to track our users and I want to call it in the Global.asa. How do I do this? I've seen the <OBJECT> tag to create an object, but I'm not sure how to use it correctly.
View Replies View RelatedI dont have any idea about Global.asa. Is it for global variable declarations?
View Replies View Relatedi'm a little bit confused with using application_onstart.. as u can see in the following code... my DB connection and SQL statements is currently included in my application_onstart event.. but, unfortunately, i wasn't able to reference Application("sUser") in my asp when i tried to run my website Code:
View Replies View RelatedWe have over 100 asp pages that reference a table (distribution_components). We added a new column and primary key to that table, so now we have to modify the where clause to include that column (we have to make the new column = to a session variable in the page)
The table appears 531 times in our code. Is there some util or method that allows us to change it globally, other than going to each occurrance, and adding the new column to the where clause.
Basically session_onend will not fire in my global.asa files! I have just made a very simple test to prove its not my programming and it still doesnt fire.
Session_onstart works a treat but onend will not work even if you force the session to expire with abandon. I have tried on 2 of our servers now and it doesnt work on either.
my simple test is this:
Sub Session_OnEnd
application("test") = "hello"
End Sub
Now surely that should work. i obviously have a page that writes that test variable to the page but its always empty.