Session objects do not persist on different web pages... why that happens ?

Discussion in 'ASP .Net' started by Newcomsas, Nov 4, 2008.

  1. Newcomsas

    Newcomsas Guest

    Hello.
    I'm rather used to include Session in my ASP classic projects and of course
    once a Session has a value assigned it is possible to retrieve it from all
    over the web site.

    This is not happening in a C# .NET project I'm working at the time. I set a
    value for 3 Sessions in a 'login' page and everything works fine (I found
    out the correct contents in the tracing informations). Problem is: when the
    user after authentication is redirected to the site's main page everything
    disappears and even in the 'Session State' section of the tracing no session
    or values are reported.

    Is there an explanation for such a behaviour ? Is there a way to make
    sessions genereted by a page readable from other pages in .NET ?

    I thank you in advance for any help

    Newcomsas
    Newcomsas, Nov 4, 2008
    #1
    1. Advertising

  2. Newcomsas

    Newcomsas Guest

    Well, you were right, thank you. In effect I tried to delete a
    Session.Abandon row several hours ago and it didn't work.
    I repetead the operation after your post and now the Sessions appear
    correctly... By the way I also added a <sessionstate tag in the web.config.
    Probably the fact it lacked was the reason why the sessions did not work.

    "Mark Rae [MVP]" <> ha scritto nel messaggio
    news:%23$...

    > Two possibilities spring to mind:
    >
    > 1) Are the login page and the main page both in the same site /
    > application?
    >
    > 2) Is there any code which could be clearing out the Session variables,
    > e.g. Session.Remove(), Session.Abandon() etc?
    Newcomsas, Nov 4, 2008
    #2
    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?RWFybCBUZWlncm9i?=

    Does session cookie persist when after session times out?

    =?Utf-8?B?RWFybCBUZWlncm9i?=, Jul 28, 2004, in forum: ASP .Net
    Replies:
    2
    Views:
    589
    Mike Newton
    Jul 28, 2004
  2. Raed Sawalha

    session variables don't persist ,why?

    Raed Sawalha, Sep 30, 2004, in forum: ASP .Net
    Replies:
    1
    Views:
    1,193
    Hermit Dave
    Sep 30, 2004
  3. Mr. SweatyFinger
    Replies:
    2
    Views:
    1,688
    Smokey Grindel
    Dec 2, 2006
  4. NM
    Replies:
    6
    Views:
    445
    Default User
    Sep 20, 2006
  5. Tim Mackey
    Replies:
    0
    Views:
    141
    Tim Mackey
    Jun 3, 2004
Loading...

Share This Page