Cannot pass session variable

Discussion in 'ASP General' started by hon123456, Sep 25, 2007.

  1. hon123456

    hon123456 Guest

    Dear all,

    I have a session variable session("loginid) which can be
    passed from A.asp to B.asp. Then In B.asp I have a hyperlink to C.asp
    e.g. < A href..C.asp>. The session variable cannot be
    passed to C.asp. The session variable is empty. What can I do to debug
    this problem?

    Thanks
    hon123456, Sep 25, 2007
    #1
    1. Advertising

  2. Gazing into my crystal ball I observed hon123456 <peterhon321
    @yahoo.com.hk> writing in news:1190730001.062425.173670@
    50g2000hsm.googlegroups.com:

    > Dear all,
    >
    > I have a session variable session("loginid) which can be
    > passed from A.asp to B.asp. Then In B.asp I have a hyperlink to C.asp
    > e.g. < A href..C.asp>. The session variable cannot be
    > passed to C.asp. The session variable is empty. What can I do to debug
    > this problem?
    >
    > Thanks
    >
    >


    The session variable should be there, unless:
    1. you are destroying it
    2. you are overwriting it with an empty value
    3. you get up and take a hour long drive, then try the page
    4. you are on another server

    --
    Adrienne Boswell at Home
    Arbpen Web Site Design Services
    http://www.cavalcade-of-coding.info
    Please respond to the group so others can share
    Adrienne Boswell, Sep 25, 2007
    #2
    1. Advertising

  3. hon123456 wrote:
    > Dear all,
    >
    > I have a session variable session("loginid) which can be
    > passed from A.asp to B.asp. Then In B.asp I have a hyperlink to C.asp
    > e.g. < A href..C.asp>. The session variable cannot be
    > passed to C.asp. The session variable is empty. What can I do to debug
    > this problem?
    >

    1. Session variables are not "passed" from one page to another. One page
    sets a session variable value, which is stored in the server's memory.
    When the next page is requested, it can read the value of the session
    variable if it has been previously set.
    2. Are all three pages in the same application/website? If not, you will
    need to find another way to make the value available across
    applications/websites: probably a database of some sort. If they are in
    the same application, you need to show us how to reproduce the symptom
    so we don't have to keep guessing.

    This might help: http://www.aspfaq.com/show.asp?id=2157

    --
    Microsoft MVP -- ASP/ASP.NET
    Please reply to the newsgroup. The email account listed in my From
    header is my spam trap, so I don't check it very often. You will get a
    quicker response by posting to the newsgroup.
    Bob Barrows [MVP], Sep 25, 2007
    #3
  4. hon123456

    Evertjan. Guest

    Bob Barrows [MVP] wrote on 25 sep 2007 in
    microsoft.public.inetserver.asp.general:

    > hon123456 wrote:
    >> Dear all,
    >>
    >> I have a session variable session("loginid) which can be
    >> passed from A.asp to B.asp. Then In B.asp I have a hyperlink to C.asp
    >> e.g. < A href..C.asp>. The session variable cannot be
    >> passed to C.asp. The session variable is empty. What can I do to debug
    >> this problem?
    >>

    > 1. Session variables are not "passed" from one page to another. One page
    > sets a session variable value, which is stored in the server's memory.
    > When the next page is requested, it can read the value of the session
    > variable if it has been previously set.
    > 2. Are all three pages in the same application/website? If not, you will
    > need to find another way to make the value available across
    > applications/websites: probably a database of some sort. If they are in
    > the same application, you need to show us how to reproduce the symptom
    > so we don't have to keep guessing.
    >
    > This might help: http://www.aspfaq.com/show.asp?id=2157
    >


    Also using session("loginid") in stead of session("loginid) could help.

    --
    Evertjan.
    The Netherlands.
    (Please change the x'es to dots in my emailaddress)
    Evertjan., Sep 25, 2007
    #4
    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. Doug Jordan

    cannot pass a variable from a function

    Doug Jordan, Jun 16, 2004, in forum: Python
    Replies:
    10
    Views:
    501
    =?iso-8859-15?Q?Pierre-Fr=E9d=E9ric_Caillaud?=
    Jun 18, 2004
  2. chowchho
    Replies:
    7
    Views:
    630
    Patrice
    Mar 28, 2008
  3. Tricky
    Replies:
    0
    Views:
    575
    Tricky
    Mar 19, 2009
  4. Tricky
    Replies:
    0
    Views:
    998
    Tricky
    Mar 19, 2009
  5. Reuven
    Replies:
    0
    Views:
    591
    Reuven
    Mar 19, 2009
Loading...

Share This Page