Logging users in/out with Session object

Discussion in 'ASP General' started by Christopher M., Dec 3, 2010.

  1. I'm using the Session object to manage things like usernames and passwords.
    (I'm not concerned about security.)

    I'm having trouble overwriting session variables when a user tries to log in
    with a different username and password.

    Exiting the browser seems to end the session. I've tried abandoning the
    session and removing the contents of the session variables but it doesn't
    seem to work.

    The site is hosted on Godaddy.

    Any ideas?

    Thanks.


    W. Pooh (AKA Winnie P.)
    Christopher M., Dec 3, 2010
    #1
    1. Advertising

  2. Christopher M.

    Bob Barrows Guest

    Christopher M. wrote:
    > I'm using the Session object to manage things like usernames and
    > passwords. (I'm not concerned about security.)


    :shock: That is the most foolhardy statement I have heard in a long time.
    >
    > I'm having trouble overwriting session variables when a user tries to
    > log in with a different username and password.


    What kind of trouble? Please try to describe your symptoms without using
    unhelpful generic terms like "not working", "having trouble", etc. We're not
    looking over your shoulder at your computer screen :)

    >
    > Exiting the browser seems to end the session.


    Well, duh! That is the definition of a session.
    Actually, a session is not cleared immediately when the browser is closed.
    Lack of activity causes it to expire which is a good thing because sessions
    consume system resources. Opening the browser again forces a new session to
    start.

    > I've tried abandoning
    > the session and removing the contents of the session variables but it
    > doesn't seem to work.



    How do you know?
    Bob Barrows, Dec 3, 2010
    #2
    1. Advertising

  3. Christopher M.

    Evertjan. Guest

    Bob Barrows wrote on 03 dec 2010 in
    microsoft.public.inetserver.asp.general:

    [...]

    > Christopher M. wrote:
    >> Exiting the browser seems to end the session.

    >
    > Well, duh! That is the definition of a session.
    > Actually, a session is not cleared immediately when the browser is
    > closed. Lack of activity causes it to expire which is a good thing
    > because sessions consume system resources. Opening the browser again
    > forces a new session to start.


    There are two reasons why a session is no-longer available.

    1 the clientside session-id cookie has expired,
    because the browser is closed.

    2 the session is closed by serverside time-out.

    3 the session is closed by a serverside session.abandon command

    4 the serverside application has/is restarted.

    Hey, I count four already.
    Bob, are there more?

    >> I've tried abandoning
    >> the session and removing the contents of the session variables but it
    >> doesn't seem to work.


    You cannot remove session-variable content of a session.abandon-ned
    session, methinks.

    > How do you know?


    Indeed.

    "Doesn't work" is unacceptable newspeak
    without showing testing ways and results.

    Show us an example script, OP.

    --
    Evertjan.
    The Netherlands.
    (Please change the x'es to dots in my emailaddress)
    Evertjan., Dec 3, 2010
    #3
    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. Satish Appasani

    Clean the session history after logging out

    Satish Appasani, Apr 12, 2004, in forum: ASP .Net
    Replies:
    1
    Views:
    404
    coollzh
    Apr 12, 2004
  2. Replies:
    0
    Views:
    413
  3. sunkrajesh
    Replies:
    0
    Views:
    347
    sunkrajesh
    May 31, 2009
  4. Satish Appasani

    Clean the session history after logging out

    Satish Appasani, Apr 12, 2004, in forum: ASP .Net Web Controls
    Replies:
    1
    Views:
    135
    Joerg Jooss
    Apr 12, 2004
  5. Jazzis
    Replies:
    2
    Views:
    232
    Jazzis
    Sep 23, 2003
Loading...

Share This Page