When referring to a single server instance only, there is a solution provided to enable a new session while destroying the previous one (thus covering any case, such as page refresh, stream-sense algorithm, etc.). In the notifyNewSession, you should throw a ConflictingSessionException. In this way, the existing session will be closed, then the new one will pass again through notifyNewSession.

If you have a server cluster, things get a bit more complicated, as the ConflictingSessionException cannot work across different servers. In this case, you need to force a session termination on a remote server (that is, a different server than the one hosting the Adapter that is handling the notifyNewSession). In this forum thread some techniques for achieving this are outlined. With the current Moderato, Allegro and Presto editions, you can only use Option 1 and Option 3 (but in the future we will enable Option 2 on all the editions). Basically, you should use a DB to keep track of the user / sessionid+server pairs in the cluster and use this information to decide if a session in the cluster should be killed at any time.