session var trouble, it's been awhile

S

stever

Hi-

I'm setting a session var in global ASA like this:
Session("Scope") = GetScopeList( Session("docRootPath") )

Where GetScopeList is a function in global.asa that will return a string
array of folder names
Session("docRootPath") is an application variable that I set earlier.

OK, when I drop Response.Write() calls in the global.asa and force an error
right after, I can determine that there is indeed an array of strings stored
in the session("Scope")

But if I try to get to that session variables in another page (*.asp) it is
always empty.

I have a basic redirect.asp page in the wwroot that redirects to a virtual
folder where my site is.

I really don't know what this could be, what would cause this variable to
get errased?

Thanks,
Steve
 
A

Aaron Bertrand - MVP

OK, when I drop Response.Write() calls in the global.asa

You can't response.write in global.asa!
But if I try to get to that session variables in another page (*.asp) it is
always empty.

Are you sure the folder that global.asa is in is marked as an application...
I have a basic redirect.asp page in the wwroot that redirects to a virtual
folder where my site is.

global.asa will apply to folders that are marked as applications. If you
virtual folder is marked as an application, it will start its own session,
rather than inheriting the one you started in the root...

A
 
A

Aaron Bertrand - MVP

sk: yes you can. It makes no sense, but you can.

In what method would you do this? How would the client ever see it?
global.asa is 'touched' but not actually loaded by the client, not presented
to the browser, etc... maybe you could show an example of how you use
response.write in global.asa.

A
 
S

stever

debugging.
When you have functions in your global.asa and you need to see either where
execution is failing OR a value of a variable, throw in a Response.Write()
and things are much easier. I'm surprised that no one sees the benefit of
that.
 
A

Aaron Bertrand - MVP

Oddly enough, the response.write is rendered on the page you open in the
browser. Why you would want to do this, though, is beyond me.

Right, but within which sub? For example, I know response is invalid in
session_onend. I haven't really explored the other subs because I abandoned
global.asa long ago...
 
B

Bob Lehmann

I place in session onstart.

Bob

Aaron Bertrand - MVP said:
Right, but within which sub? For example, I know response is invalid in
session_onend. I haven't really explored the other subs because I abandoned
global.asa long ago...
 
B

Bob Lehmann

uh yeah, I know response.write is useful for debugging. It's unusal to use
global.asa in the manner you are using it.


Bob Lehmann
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,768
Messages
2,569,575
Members
45,051
Latest member
CarleyMcCr

Latest Threads

Top