Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Global.asa

Posted on 2002-05-28
6
Medium Priority
?
349 Views
Last Modified: 2013-12-24
It's gotta be a dumb question -

How do I create the global.asa file?

What are the required values?

Any good reading on global.asa?
0
Comment
Question by:goldstar
6 Comments
 
LVL 19

Expert Comment

by:webwoman
ID: 7039539
You don't need to create one. The only use is if you're custom coding ASP pages and know EXACTLY what you're doing. I've got lots of ASP pages, database connections, includes, forms, etc. and I don't have one. Everything works just fine without it.

Sometimes FP will create one if it needs it. If it doesn't make one, you don't need it. ;-)
0
 
LVL 10

Expert Comment

by:KenAdney
ID: 7040507
webwoman is, as alway, correct.  There's some more info about the content/purpose of the file at: http://msdn.microsoft.com/library/default.asp?url=/library/en-us/iisref/html/psdk/asp/glob63vp.asp
0
 

Author Comment

by:goldstar
ID: 7041719
I have a series of pages (all within a virtual directory) that can be accessed only with a userid & password.  

My intent is to store a variable after the user has successfully logged in from the login page.  

I want to check for this variable on all pages witin the virtual directory to prevent access from a bookkmarked page.

Is the global.asa needed for this?

If not, could you give an example of what the "check for status of variable would like?  I've been trying this on the pages:

if session("logged_in") <> "Y" then
     response.redirect "//http:999.9.9.99/login.asp"
end if

and this is on the authentication page:
<%
dim x
x = Request.ServerVariables("HTTP_REFERER")
if x = "http://999.9.9.999/authenticated.asp" then
     session("logged_in") = "Yes"
     'response.write "Session: " + session("logged_in")
else
     session("logged_in") = "No"
     response.redirect "http://158.6.1.76/login.asp"
end if
%>

But the variable does not get passed.  That is why is thought about the asa file.

0
Prepare for your VMware VCP6-DCV exam.

Josh Coen and Jason Langer have prepared the latest edition of VCP study guide. Both authors have been working in the IT field for more than a decade, and both hold VMware certifications. This 163-page guide covers all 10 of the exam blueprint sections.

 
LVL 19

Expert Comment

by:webwoman
ID: 7043260
Set a cookie... but you have to do it BEFORE you write any HTML content.

You're checking the wrong thing. If you want to check the referring document URL, you can use javascript -- document.referrer does exactly that. If you want to set something for the client, a cookie is easier. You can do a session variable as well, which is basically a cookie stored on the server.

You do that on the first page. On the first and the other pages, you check to see if the cookie exists, and if the login value is 'logged in' (for example). If it does, they're logged in. If it doesn't, they're not. You can then redirect from there.

I'd have to look up the proper syntax, but any good ASP tutorial site should have it. Check www.asp101.com -- they usually have good tutorials.
0
 
LVL 1

Accepted Solution

by:
choroque earned 150 total points
ID: 7048357
The global.asa file is automatically created if you create a new project using Visual Interdev.
0
 

Author Comment

by:goldstar
ID: 7050906
Thanks for the answer to my question.
0

Featured Post

Prepare for your VMware VCP6-DCV exam.

Josh Coen and Jason Langer have prepared the latest edition of VCP study guide. Both authors have been working in the IT field for more than a decade, and both hold VMware certifications. This 163-page guide covers all 10 of the exam blueprint sections.

Question has a verified solution.

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

Now that Expression Web 4.0 (http://www.microsoft.com/expression/products/Upgrade.aspx) is free if you buy or have the full version of Expression Web 3.0, now is the best time to  migrate from FrontPage to Expression Web (http://www.frontpage-to-exp…
Originally, this post was published on Monitis Blog, you can check it here . It goes without saying that technology has transformed society and the very nature of how we live, work, and communicate in ways that would’ve been incomprehensible 5 ye…
The purpose of this video is to demonstrate how to manually back up a WordPress Database. This will be demonstrated using a Windows 8 PC. The Host used will be IPage.com Log into your Hosting account. IPage will be used for demonstration : Locat…
The purpose of this video is to demonstrate how to Import and export files in WordPress. This will be demonstrated using a Windows 8 PC. Go to your WordPress login page. This will look like the following: mywebsite.com/wp-login.php : Click on Too…
Suggested Courses

963 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