session var trouble, it's been awhile

Discussion in 'ASP General' started by stever, Aug 20, 2003.

  1. stever

    stever Guest

    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
    stever, Aug 20, 2003
    #1
    1. Advertising

  2. > 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
    Aaron Bertrand - MVP, Aug 20, 2003
    #2
    1. Advertising

  3. > 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
    Aaron Bertrand - MVP, Aug 20, 2003
    #3
  4. stever

    stever Guest

    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
    > >
    > >

    >
    >
    stever, Aug 20, 2003
    #4
  5. > 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...
    Aaron Bertrand - MVP, Aug 20, 2003
    #5
  6. stever

    Bob Lehmann Guest

    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...
    >
    >
    Bob Lehmann, Aug 21, 2003
    #6
  7. stever

    Bob Lehmann Guest

    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
    > > >
    > > >

    > >
    > >

    >
    >
    Bob Lehmann, Aug 21, 2003
    #7
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. mark
    Replies:
    2
    Views:
    442
    mark dondero
    Oct 30, 2003
  2. Alvin Bruney

    Threads.. Session var lost, App var ok

    Alvin Bruney, Dec 2, 2003, in forum: ASP .Net
    Replies:
    1
    Views:
    349
    rooster575
    Dec 2, 2003
  3. thomson
    Replies:
    10
    Views:
    2,476
    Eliyahu Goldin
    Jun 20, 2005
  4. thomson
    Replies:
    0
    Views:
    363
    thomson
    Jun 20, 2005
  5. Fred
    Replies:
    3
    Views:
    314
    Alf P. Steinbach
    Aug 10, 2003
Loading...

Share This Page