Search code examples
javasessionglassfishdestroy

How to destroy all GlassFish sessions from Admin Panel


I am running a J2EE website on a GlassFish 4.0 server. I want to destroy all sessions of an application from the GlassFish Administration Panel (Accessed from the web, by default on port 4848). How can I accomplish that? I looked through the panel, and haven't found that feature on it myself.


Solution

  • I guess you mean HTTP sessions. There is no direct way to accomplish what you want.

    However, you can simply restart your web application in the Administration Panel under Applications by hitting either Reload or Redeploy.

    This will destroy all sessions, but also has some disadvantages. It can be a lengthy process depending on the "size" of your web application. It may also clear caches built up by your application and things like established database connections. You should make sure that restarting the application doesn't cause any undesired side effects.