Session object value not displaying

Discussion in 'ASP General' started by .Net Sports, Jul 6, 2009.

  1. .Net Sports

    .Net Sports Guest

    In an asp password script, i'm trying to grab the user's level of
    access inside the database and display it on the next page after
    successful login

    '''login.asp has this:

    session("levelAcc")=objRec.fields("levelAcc")


    '''the landingpage.asp , the first page afte logging in successfully,
    has this:
    <%=response.write(session("levelAcc"))%>

    ....but I do not see the display of the access level on the
    landingpage.asp page

    ???
    NS
    .Net Sports, Jul 6, 2009
    #1
    1. Advertising

  2. .Net Sports

    Evertjan. Guest

    ..Net Sports wrote on 06 jul 2009 in
    microsoft.public.inetserver.asp.general:

    > <%=response.write(session("levelAcc"))%>
    >
    > ...but I do not see the display of the access level on the
    > landingpage.asp page


    Elementary, my dear Watson,

    [stipulating that we are talking VBS]

    It is either:

    <% response.write(session("levelAcc")) %>

    or better without the unnecessary ():

    <% response.write session("levelAcc") %>

    or:

    <% = session("levelAcc") %>

    --
    Evertjan.
    The Netherlands.
    (Please change the x'es to dots in my emailaddress)
    Evertjan., Jul 6, 2009
    #2
    1. Advertising

  3. .Net Sports

    .Net Sports Guest

    On Jul 6, 10:21 am, "Evertjan." <> wrote:
    > .Net Sports wrote on 06 jul 2009 in
    > microsoft.public.inetserver.asp.general:
    >
    > > <%=response.write(session("levelAcc"))%>

    >
    > > ...but I do not see the display of the access level on the
    > > landingpage.asp page

    >
    > Elementary, my dear Watson,
    >
    > [stipulating that we are talking VBS]
    >
    > It is either:
    >
    > <% response.write(session("levelAcc")) %>
    >
    > or better without the unnecessary ():
    >
    > <% response.write session("levelAcc") %>
    >
    > or:
    >
    > <% = session("levelAcc") %>
    >
    > --
    > Evertjan.
    > The Netherlands.
    > (Please change the x'es to dots in my emailaddress)


    sherlock, it's not working. None of the 3 work. I've even assigned
    session("levelAcc") a hardcoded value : session("levelAcc") = 1, and
    tried session("levelAcc") ="test", and it doesnt display . :-(
    .Net Sports, Jul 6, 2009
    #3
  4. .Net Sports

    Bob Barrows Guest

    ..Net Sports wrote:
    > In an asp password script, i'm trying to grab the user's level of
    > access inside the database and display it on the next page after
    > successful login
    >
    > '''login.asp has this:
    >
    > session("levelAcc")=objRec.fields("levelAcc")
    >
    >
    > '''the landingpage.asp , the first page afte logging in successfully,
    > has this:
    > <%=response.write(session("levelAcc"))%>
    >
    > ...but I do not see the display of the access level on the
    > landingpage.asp page
    >

    "<%=" is shorthand for "<% Response.Write", so all that is needed is:
    <%=session("levelAcc")%>


    --
    Microsoft MVP - ASP/ASP.NET - 2004-2007
    Please reply to the newsgroup. This email account is my spam trap so I
    don't check it very often. If you must reply off-line, then remove the
    "NO SPAM"
    Bob Barrows, Jul 6, 2009
    #4
  5. .Net Sports

    Evertjan. Guest

    ..Net Sports wrote on 06 jul 2009 in
    microsoft.public.inetserver.asp.general:

    > On Jul 6, 10:21 am, "Evertjan." <> wrote:
    >> .Net Sports wrote on 06 jul 2009 in
    >> microsoft.public.inetserver.asp.general:
    >>
    >> > <%=response.write(session("levelAcc"))%>

    >>
    >> > ...but I do not see the display of the access level on the
    >> > landingpage.asp page

    >>
    >> Elementary, my dear Watson,
    >>
    >> [stipulating that we are talking VBS]
    >>
    >> It is either:
    >>
    >> <% response.write(session("levelAcc")) %>
    >>
    >> or better without the unnecessary ():
    >>
    >> <% response.write session("levelAcc") %>
    >>
    >> or:
    >>
    >> <% = session("levelAcc") %>


    [please do not quote signatures on usenet]

    >
    > sherlock, it's not working. None of the 3 work. I've even assigned
    > session("levelAcc") a hardcoded value : session("levelAcc") = 1, and
    > tried session("levelAcc") ="test", and it doesnt display . :-(


    Oh yes, they work, you must make a mistake wat you are not telling.

    Like your browser having the session cookies switched off or not using an
    ASP enabled server.


    --
    Evertjan.
    The Netherlands.
    (Please change the x'es to dots in my emailaddress)
    Evertjan., Jul 6, 2009
    #5
  6. .Net Sports

    .Net Sports Guest


    >
    > > sherlock, it's not working. None of the 3 work. I've even assigned
    > > session("levelAcc") a hardcoded value :  session("levelAcc") = 1, and
    > > tried session("levelAcc") ="test", and it doesnt display . :-(

    >
    > Oh yes, they work, you must make a mistake wat you are not telling.
    >
    > Like your browser having the session cookies switched off or not using an
    > ASP enabled server.
    >


    sherlock, thanks for helping...no, the cookies and server is good, on
    this page in question when i do this: <%= request.querystring
    ("level") %> from a querystring, it works. Just wondering what's
    stopping this session object not to display :-(
    .Net Sports, Jul 6, 2009
    #6
  7. .Net Sports

    Bob Barrows Guest

    ..Net Sports wrote:
    >>> sherlock, it's not working. None of the 3 work. I've even assigned
    >>> session("levelAcc") a hardcoded value : session("levelAcc") = 1, and
    >>> tried session("levelAcc") ="test", and it doesnt display . :-(


    Wait a minute. Be more explicit please. Are you saying you have tried this?
    <%
    session("levelAcc") ="test"
    Response.Write session("levelAcc")
    %.

    Or are you talking about setting the session variable value on one page and
    attempting to display it on another? If so, at least make sure the above
    test page successfully displays the word "test" when run.

    >>
    >> Oh yes, they work, you must make a mistake wat you are not telling.
    >>
    >> Like your browser having the session cookies switched off or not
    >> using an ASP enabled server.
    >>

    >
    > sherlock, thanks for helping...no, the cookies and server is good, on
    > this page in question when i do this: <%= request.querystring
    > ("level") %> from a querystring, it works.


    That proves nothing. The querystring does not rely on cookies - it is just
    taken from the url. Check out these articles
    http://classicasp.aspfaq.com/general/why-won-t-my-session-variables-stick.html
    http://classicasp.aspfaq.com/general/why-do-my-session/application-variables-disappear.html

    Make sure you have created an application for your website in IIS Manager


    --
    Microsoft MVP - ASP/ASP.NET - 2004-2007
    Please reply to the newsgroup. This email account is my spam trap so I
    don't check it very often. If you must reply off-line, then remove the
    "NO SPAM"
    Bob Barrows, Jul 6, 2009
    #7
  8. .Net Sports

    .Net Sports Guest

    On Jul 6, 11:55 am, "Bob Barrows" <> wrote:
    > .Net Sports wrote:
    > >>> sherlock, it's not working. None of the 3 work. I've even assigned
    > >>> session("levelAcc") a hardcoded value : session("levelAcc") = 1, and
    > >>> tried session("levelAcc") ="test", and it doesnt display . :-(

    >
    > Wait a minute. Be more explicit please. Are you saying you have tried this?
    > <%
    > session("levelAcc") ="test"
    > Response.Write session("levelAcc")
    > %.
    >
    > Or are you talking about setting the session variable value on one page and
    > attempting to display it on another? If so, at least make sure the above
    > test page successfully displays the word "test" when run.
    >
    >
    >
    > >> Oh yes, they work, you must make a mistake wat you are not telling.

    >
    > >> Like your browser having the session cookies switched off or not
    > >> using an ASP enabled server.

    >
    > > sherlock, thanks for helping...no, the cookies and server is good, on
    > > this page in question when i do this:  <%= request.querystring
    > > ("level") %> from a querystring, it works.

    >
    > That proves nothing. The querystring does not rely on cookies - it is just
    > taken from the url. Check out these articleshttp://classicasp.aspfaq.com/general/why-won-t-my-session-variables-s...http://classicasp.aspfaq.com/general/why-do-my-session/application-va...
    >
    > Make sure  you have created an application for your website in IIS Manager
    >
    > --
    > Microsoft MVP - ASP/ASP.NET - 2004-2007
    > Please reply to the newsgroup. This email account is my spam trap so I
    > don't check it very often. If you must reply off-line, then remove the
    > "NO SPAM"


    OK, I was establishing the session object after a redirect to the
    landingpage, so it wasn't reading it...i made sure the directory live
    was set as an application...now everything works, thanx!
    .Net Sports, Jul 7, 2009
    #8
    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. =?Utf-8?B?RGlmZmlkZW50?=
    Replies:
    3
    Views:
    816
    Juan T. Llibre
    May 13, 2005
  2. Jon   Paal
    Replies:
    2
    Views:
    555
    Jon Paal
    Mar 17, 2006
  3. momo898
    Replies:
    2
    Views:
    485
    bruce barker \(sqlwork.com\)
    Oct 12, 2006
  4. xbound
    Replies:
    1
    Views:
    472
    Mr. Arnold
    May 19, 2010
  5. Gretjns
    Replies:
    3
    Views:
    206
    Richard Cornford
    Oct 7, 2004
Loading...

Share This Page