On Session Remove - Weblogic

This is a discussion on On Session Remove - Weblogic ; Hello All, I want to execute some code when the session object assosiated with the user times out and is invalidated by the user. How can I do this? How can I get a callback when the server removes a ...

+ Reply to Thread
Results 1 to 3 of 3

Thread: On Session Remove

  1. On Session Remove

    Hello All,

    I want to execute some code when the session object assosiated with the
    user times out and is invalidated by the user.

    How can I do this? How can I get a callback when the server removes a
    session object from memory because of timeout?

    Thanks for your help in advance.

    regards,
    Abhishek.

  2. Re: On Session Remove

    Add a listener entry in the web.xml


    com.amcc.portal.sessionListener


    The code looks like this:

    package com.amcc.portal;

    import javax.servlet.http.*;
    import java.util.*;

    /**
    * Web Application Http Session Listener.
    * Used to do session timeout housekeeping and is defined in
    * the web.xml file.
    */

    public class sessionListener implements HttpSessionListener {
    private cacheManager cache = null;

    public sessionListener() {
    }

    public void sessionCreated(HttpSessionEvent event) {
    }

    public void sessionDestroyed(HttpSessionEvent event) {
    HttpSession session = event.getSession();

    // Check to see if this is a valid session
    if (SessionHelper.userIsRegistered(session)) {
    // Do something
    }
    }

    }
    Abhishek Srivastava wrote:
    > Hello All,
    >
    > I want to execute some code when the session object assosiated with the
    > user times out and is invalidated by the user.
    >
    > How can I do this? How can I get a callback when the server removes a
    > session object from memory because of timeout?
    >
    > Thanks for your help in advance.
    >
    > regards,
    > Abhishek.


  3. Re: On Session Remove

    remove this line

    private cacheManager cache = null;

    Jay Zimmett wrote:

    > Add a listener entry in the web.xml
    >
    >
    > com.amcc.portal.sessionListener
    >

    >
    > The code looks like this:
    >
    > package com.amcc.portal;
    >
    > import javax.servlet.http.*;
    > import java.util.*;
    >
    > /**
    > * Web Application Http Session Listener.
    > * Used to do session timeout housekeeping and is defined in
    > * the web.xml file.
    > */
    >
    > public class sessionListener implements HttpSessionListener {
    > private cacheManager cache = null;
    >
    > public sessionListener() {
    > }
    >
    > public void sessionCreated(HttpSessionEvent event) {
    > }
    >
    > public void sessionDestroyed(HttpSessionEvent event) {
    > HttpSession session = event.getSession();
    >
    > // Check to see if this is a valid session
    > if (SessionHelper.userIsRegistered(session)) {
    > // Do something
    > }
    > }
    >
    > }
    > Abhishek Srivastava wrote:
    >
    >> Hello All,
    >>
    >> I want to execute some code when the session object assosiated with
    >> the user times out and is invalidated by the user.
    >>
    >> How can I do this? How can I get a callback when the server removes a
    >> session object from memory because of timeout?
    >>
    >> Thanks for your help in advance.
    >>
    >> regards,
    >> Abhishek.


+ Reply to Thread