Session.arggh

Results 1 to 5 of 5

Thread: Session.arggh

  1. #1
    Daniel Root Guest

    Default Session.arggh

    I keep having this problem with Sessions, keep thinking I&#039ve fixed it, and keep being wrong. Basically, Session variables aren&#039t accessable where I think they should be. For instance, a user logs in, and the username is taken from a cookie and put into session("Username"). I can read it from a script in the root directory. But when I try from another directory off the root(Which the IIS Manager says is NOT another Application) It returns a blank string.<BR><BR>What am I missing here?

  2. #2
    Join Date
    Dec 1969
    Posts
    760

    Default RE: Session.arggh describe the problem

    You are missing details about your problem.<BR>Are you opening a new browser window?<BR>Does the problem occur with both/all browsers<BR><BR><BR><BR><BR>RE:<BR>Session.arggh<B R> <BR>Daniel Root - 26 Jul - 11:16:16 AM<BR>--------------------------------------------------------------------------------<BR>I keep having this problem with Sessions, keep thinking I&#039ve fixed it, and keep being wrong. Basically, Session variables aren&#039t accessable where I think they should be. For instance, a user logs in, and the username is taken from a cookie and put into session("Username"). I can read it from a script in the root directory. But when I try from another directory off the root(Which the IIS Manager says is NOT another Application) It returns a blank string.<BR><BR>What am I missing here? <BR>

  3. #3
    Frank Salinas Guest

    Default RE: Session.arggh describe the problem

    If I&#039m understanding what you said, I think the problem is correctly understanding what the scope of the Session variable is. A Session variable is accessible only within the scope of the current user connection. If you are not the one connected to the user session, you cannot see the session variable (for example: You open another browser window). NOW, if you are the user and you cannot access then there is a bug somewhere. <BR>If you want a variable to accessible globally, try putting it in the Application variable - Application("variable_name_XX"), though this would not be a good place to put user names since each time a user connected this variable would change. You could try putting the user name plus a unique number behind it like shown above.<BR>Frank Salinas

  4. #4
    Matthew Hazlett Guest

    Default RE: Session.arggh

    If you are using a popup window and setting the session there it will be lost when the window is closed.


  5. #5
    Daniel Root Guest

    Default RE: Session.arggh describe the problem

    Well, this problem occurs in one browser, with one user. According to the other reply, I shouldn&#039t pop-up a window, set a session there, and then close the window. That&#039s what was happening, so I changed to not do that and things &#062;seem&#060; to work alright, except that I still get different sessions between frames in the same window. There are three different frames, and all three register a different session ID. I get around this by looking up user info in a database each time it&#039s needed. Not server-friendly, but it should work for now.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •