Can I Implement Session Without Global.asa File In My Root Directory....
Can I implement session without global.asa file in my root directory....and is there any good site for sessions tutorial.
View RepliesCan I implement session without global.asa file in my root directory....and is there any good site for sessions tutorial.
View Replieswhere does the file need to be?(root directory of server? main directory of my application?)
I don't need to include the global.asa file in my asp pages to reference the application variables, right?
can I use application variables without using a global.asa file?
when using a global.asa file, do I need to restart the server(or IIS) every time I make changes to it, or does the application automaticaly reset once a change has been made to it?
at the mo I have a global.asa file that looks like this.
<script language="vbscript" runat="server">
Sub Application_OnStart
Application("visitors")=0
End Sub
Sub Session_OnStart
Application.Lock
Application("visitors")=Application("visitors")+1
Application.UnLock
End Sub
Sub Session_OnEnd
Application.Lock
Application("visitors")=Application("visitors")-1
Application.UnLock
End Sub
</script>
and then I have this line in the asp page to display the number of visitors...
Code:
response.write(Application("visitors"))
I get nothing...!
what am I missing?
If I don't set a vritual directory for the new application on the IIS (simpley copy the new application to a parent virtual directory), the new application's Global.asa file won't work. Right?
View Replies View RelatedI have a situation which i am sure has arisen previously. But for the life of me i cant figure out how to get this to work.
I have a directory setup like this:
Site1 - www.site1.com
Asp -
Images -
Site2 - www.site2.com
Asp -
Images -
The problem that i am having is i cant get site 2 to display images from site 1 using the virtual path '../' as this only takes you to the root of site 2 and wont let me out of it.
I have tried to use the full path of http://www.site1.com/Images but this seems to take an a really long time to load the images.
Is it possible to go outside of this root directory using some kind of trick? I dont want to copy the images accross to site 2 either as there are actually hundreds of sites that will be referencing site1's image folder and it is updated regularly.
I was thinking of putting a virtual directory in site1 thatpointed to the image folder in site2 but i couldnt get that to work.
Can I put a session.timeout = "45" in the global.asa file? and if yes, under what section?
View Replies View RelatedI 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.
i 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.
my isp has created a directory with read/write access above the domain root. I asked them to do this to make it safer. I have used 'freeasp upload' to create an upload page (which works) but now I can't access the image files in this new directory. How do you guys deal with uploading images in a CMS admin and then retrieving them on the public site?
View Replies View Relatedwhere 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 Replies View RelatedI'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 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 used KB 308150 as a guide to create a virtual directory shared by a few webstores that my company hosts. The virtual folder and websites reside on the same box. The shared directory includes code files used by all the webstores.
The problem - when a user adds items to the shopping cart, ***sometimes*** the session variables get reset and all cart information is lost. I can't consistently make the error occur - it seems to be random.
Also, if you have any different ideas on how to share code between many websites...I'm all ears.
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?
What 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 am in much need of some help with my global.asa file. I use ASP and mySQL. In a nutshell, When a registered user logs in, a field in I have a field that gets updated in my DB Table. It is a TINYINT. When they log in, it updates the value to 1, when they log out, it updates it to 0. I use a tiny iFrame to create a loop displaying users with the value of 1. Basically a cheasy "Who's Online" function.
How ever I am now trying to create a global.asa file to say when the session times out, I want the global file to just update the value back to 0. I am also attempting it so that if the users browser window closes and then gets reopened PRIOR to the timeout limit, It knows they are still logged in. I can provide my script if anyone thinks they can help. !!!!!!!!!!!!!!!!!!!
I think my final thought would be that when the user closes their browser, that the session ends and the DB field gets updated from a 1 to a 0.
I have written general purpose functions in one of the include file, I want
to use the same in the global.asa. Do you know how to use include file in
global.asa
Users are required to log into my website. I store the users name in a session variable. If the user doesn't log out and the session expires after 20 minutes, is it permissable to have code in the session end function of the global.asa which accesses a database and makes alterations to the users login status?
The reason I ask this is that I am having problems trying to get the logout to work for sessions which have timed out. If the users logout using the logout button, the code works fine.
It seems to me that I generally use two types of Functions:
Type #1-Ones that any page on my site might use
Type #2-Ones that only a single page would ever use
Logically, it seems that I should put the Type #1 functions in the GLOBAL.ASA file and the Type #2 functions in the pages that use them. I would like to, however, just go ahead and include ALL of my functions in the GLOBAL.ASA file.
Comments on this? Is this a good idea?
My website is hosted with the ISP and recently I have modified my Global.asa file for the ASP application.
So I think we need to restart the World Wide Web Publishing Service so that the changes in the Global.asa will take effect. I think it will be difficult for the ISP to restart the Service as there many applications will be running. So can you suggest how can my global.asa file changes will take effect so that I can deply those changes?
I'm trying to debug a problem that some users of our ASP app see that
goes away when they clear their cookies.
I've gotten a copy of their cookie for our app and have renamed it
from Join Bytes! to Join Bytes!. However, when I
navigate to testsite, I see it create a Join Bytes!. What are
the rules as far as what gets written to the C:Documents and Settings
%Username%Cookies?In theory I would think that if the problem is with information stored
in a cookie and I save another user's cookie on my machine, and change
the filename to match my user name I should be able to reproduce it,
but it doesn't seem to be working.
Is there a way to implement a combo box, like in access in ASP? Or is there another way to have the same result. I want to make a page where people can choose an item in a list, but add one if it isn't in the list.
View Replies View RelatedI am creating a text file on the server which once created I need to then copy to another directory on the network.
View Replies View RelatedI'm coding a page where you can download a lot of different files( 100-1000) but I don't want to code each file(linking and all) it would take weeks to do that. I tried with a database and asp code rding the databse but it not saving a lot of time since I got to complete the databse.
I wanna know if we can code with asp something to automaticly read each file and list them in html so I dont have to code 1000 x the samee thing.