Archived

This forum has been archived. Please start a new discussion on GitHub.

How to determine the reason of a destroyed session

Hello I would like to know how i can determine why a session i've been destroyed. I'm using glacier2, when i've a proxy on a session i can call the destroy method from the client side to kill the session. However, when a timeout appears, the session is also called, and the destroy method of the session seems to be automatically called.

On the server side, i would like to determine what is the reason that kills a session.

Thank you.


Joel

Comments

  • matthew
    matthew NL, Canada
    With the current setup there is no way to know this. Why do you want to know that information?
  • Just to keep an history of session life cycle ...

    Thank you

    Joël
  • matthew
    matthew NL, Canada
    There is no direct way to do that. The simplest way I can think to do it is add a new method on your derived session that your application calls instead of destroy(). For example:

    interface MySession extends Glacier2::Session
    {
    void logout();
    };

    Then your application calls logout, which in sets a flag and calls destroy. In this way you know if destroy is called directly it was destroyed by a session timeout, otherwise it was destroyed by your application.