session end problem in jsp

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • megha

    session end problem in jsp

    Hi

    I am writing a program in JSP which requires user to log in and as he
    logs in database was updated with his status on and till the user does
    not sign out no other user with same login and password can enter in
    the system. as he signs out database was updated but the problem is if
    somehow he forgot to sign out and closed the browser or navigate to
    other page or site his information was still on in the database. I
    want a solution how to update a database when users forgot to signout
    but closed the window or browser.
    I am using Apache Tomcat ver 4.1.27 with Jsp and SQLServer7.0

    Thanks

    Megha
  • Herman Timmermans

    #2
    Re: session end problem in jsp

    megha wrote:
    [color=blue]
    > Hi
    >
    > I am writing a program in JSP which requires user to log in and as he
    > logs in database was updated with his status on and till the user does
    > not sign out no other user with same login and password can enter in
    > the system. as he signs out database was updated but the problem is if
    > somehow he forgot to sign out and closed the browser or navigate to
    > other page or site his information was still on in the database. I
    > want a solution how to update a database when users forgot to signout
    > but closed the window or browser.
    > I am using Apache Tomcat ver 4.1.27 with Jsp and SQLServer7.0
    >
    > Thanks
    >
    > Megha[/color]
    You should implement the HttpSessionList ener interface. In case a session
    is invalidated either by a pre-defined time-out or when the user closes his
    browser, the sessionDestroye d method is called. Use this method to
    clean-up whatever that needs to be done in your database when the user
    forgets to do a proper logoff.
    Brgds,
    Herman
    --
    Suse Linux Professional 8.1 on Athlon 1.1 Ghz 512 Mb
    Anti Spam = remove the "dot" and the "at"
    Registered Linux User #264690

    Comment

    • Raymond DeCampo

      #3
      Re: session end problem in jsp

      Herman Timmermans wrote:[color=blue]
      > megha wrote:
      >
      >[color=green]
      >>Hi
      >>
      >>I am writing a program in JSP which requires user to log in and as he
      >>logs in database was updated with his status on and till the user does
      >>not sign out no other user with same login and password can enter in
      >>the system. as he signs out database was updated but the problem is if
      >>somehow he forgot to sign out and closed the browser or navigate to
      >>other page or site his information was still on in the database. I
      >>want a solution how to update a database when users forgot to signout
      >>but closed the window or browser.
      >>I am using Apache Tomcat ver 4.1.27 with Jsp and SQLServer7.0
      >>
      >>Thanks
      >>
      >>Megha[/color]
      >
      > You should implement the HttpSessionList ener interface. In case a session
      > is invalidated either by a pre-defined time-out or when the user closes his
      > browser, the sessionDestroye d method is called. Use this method to
      > clean-up whatever that needs to be done in your database when the user
      > forgets to do a proper logoff.[/color]

      I would point out that when the user closes his or her browser, the
      session is not invalidated. (Assuming the browsers haven't changed.)
      So you will still be stuck with the session hanging around until the
      server times it out, during which time the user will be locked out of
      his or her application!

      Ray

      Comment

      • megha

        #4
        Re: session end problem in jsp

        Hi

        I am not able to bind a session with particular user though I am using
        httpsessionlist ener interface
        I used the following code in destroyed method

        login = session.getAttr ibute("user");

        Tell me how I can do it.
        Thanks
        Megha



        Raymond DeCampo <rdecampo@spa m-I-am-not.twcny.rr.co m> wrote in message news:<wSvCb.819 9$JW3.3407@twis ter.nyroc.rr.co m>...[color=blue]
        > Herman Timmermans wrote:[color=green]
        > > megha wrote:
        > >
        > >[color=darkred]
        > >>Hi
        > >>
        > >>I am writing a program in JSP which requires user to log in and as he
        > >>logs in database was updated with his status on and till the user does
        > >>not sign out no other user with same login and password can enter in
        > >>the system. as he signs out database was updated but the problem is if
        > >>somehow he forgot to sign out and closed the browser or navigate to
        > >>other page or site his information was still on in the database. I
        > >>want a solution how to update a database when users forgot to signout
        > >>but closed the window or browser.
        > >>I am using Apache Tomcat ver 4.1.27 with Jsp and SQLServer7.0
        > >>
        > >>Thanks
        > >>
        > >>Megha[/color]
        > >
        > > You should implement the HttpSessionList ener interface. In case a session
        > > is invalidated either by a pre-defined time-out or when the user closes his
        > > browser, the sessionDestroye d method is called. Use this method to
        > > clean-up whatever that needs to be done in your database when the user
        > > forgets to do a proper logoff.[/color]
        >
        > I would point out that when the user closes his or her browser, the
        > session is not invalidated. (Assuming the browsers haven't changed.)
        > So you will still be stuck with the session hanging around until the
        > server times it out, during which time the user will be locked out of
        > his or her application!
        >
        > Ray[/color]

        Comment

        Working...