Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP General > session var trouble, it's been awhile

Reply
Thread Tools

session var trouble, it's been awhile

 
 
stever
Guest
Posts: n/a
 
      08-20-2003
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


 
Reply With Quote
 
 
 
 
Aaron Bertrand - MVP
Guest
Posts: n/a
 
      08-20-2003
> 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


 
Reply With Quote
 
 
 
 
Aaron Bertrand - MVP
Guest
Posts: n/a
 
      08-20-2003
> 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


 
Reply With Quote
 
stever
Guest
Posts: n/a
 
      08-20-2003
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.


"Bob Lehmann" <> wrote in message
news:...
> 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.
>
> Bob Lehmann
>
> "Aaron Bertrand - MVP" <> wrote in message
> news:...
> > > 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
> >
> >

>
>



 
Reply With Quote
 
Aaron Bertrand - MVP
Guest
Posts: n/a
 
      08-20-2003
> 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...


 
Reply With Quote
 
Bob Lehmann
Guest
Posts: n/a
 
      08-20-2003
I place in session onstart.

Bob

"Aaron Bertrand - MVP" <> wrote in message
news:...
> > 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...
>
>



 
Reply With Quote
 
Bob Lehmann
Guest
Posts: n/a
 
      08-20-2003
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

"stever" <> wrote in message
news:...
> 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.
>
>
> "Bob Lehmann" <> wrote in message
> news:...
> > 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.
> >
> > Bob Lehmann
> >
> > "Aaron Bertrand - MVP" <> wrote in message
> > news:...
> > > > 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
> > >
> > >

> >
> >

>
>



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
its been awhile here Keith Chilton MCDST 4 04-10-2007 09:49 PM
Difference between Session["var"] and Session("var") thomson ASP .Net 10 06-20-2005 01:02 PM
Difference between Session["var"] and Session("var") thomson ASP .Net 0 06-20-2005 10:54 AM
Threads.. Session var lost, App var ok Alvin Bruney ASP .Net 1 12-02-2003 01:56 AM
Asp.net web application fails to Access db after surfing for awhile mark ASP .Net 2 10-30-2003 05:02 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57