{"id":120,"date":"2017-10-11T22:59:35","date_gmt":"2017-10-11T20:59:35","guid":{"rendered":"http:\/\/corsaire-consulting.fr\/blog\/?p=120"},"modified":"2017-11-11T13:16:36","modified_gmt":"2017-11-11T12:16:36","slug":"wlst-supprimer-toutes-les-sessions-http-dune-application-web","status":"publish","type":"post","link":"https:\/\/corsaire-consulting.fr\/blog\/index.php\/2017\/10\/11\/wlst-supprimer-toutes-les-sessions-http-dune-application-web\/","title":{"rendered":"WLST &#8211; Supprimer toutes les sessions HTTP d&rsquo;une application web"},"content":{"rendered":"<p>Lors de tests, il est parfois utile de pouvoir supprimer toutes les sessions HTTP en cours sur un serveur. Le script WLST suivant permet de r\u00e9aliser cette op\u00e9ration :<!--more--><\/p>\n<p>&nbsp;<\/p>\n<p>[pastacode lang=\u00a0\u00bbpython\u00a0\u00bb manual=\u00a0\u00bbhost%3D%22&#8230;%22%0Aport%3D%22&#8230;%22%0Ausername%3D%22&#8230;%22%0Apassword%3D%22&#8230;%22%0A%0AwebApp%3D%22&#8230;%22%0AentApp%3D%22&#8230;%22%0A%0AserverName%3D%22AdminServer%22%0A%0Aprint%20%22Connexion%20au%20serveur&#8230;%22%0Aconnect(username%2Cpassword%2C%20host%2B%22%3A%22%2Bport)%0A%0AserverRuntime()%0Acd(&lsquo;ApplicationRuntimes%2F&rsquo;%20%2B%20entApp%20%2B%20&rsquo;%2FComponentRuntimes%2F&rsquo;%20%2B%20serverName%20%2B%20&rsquo;_%2F&rsquo;%20%2B%20webApp)%20%0AMIDs%20%3D%20cmo.getServletSessionsMonitoringIds()%0A%0Aprint%20%22Nombre%20de%20sessions%20dans%20l&rsquo;application%20%22%2BentApp%2B%22%2F%22%2BwebApp%2B%22%20%3A%20%22%2Bstr(len(MIDs))%0A%0Afor%20mid%20in%20MIDs%3A%0A%20%20%20%20%20%20%20%20print%20%22Suppression%20de%20la%20session%20%22%20%2B%20mid%0A%20%20%20%20%20%20%20%20cmo.invalidateServletSession(mid)%20%0A%0A%0AMIDs%20%3D%20cmo.getServletSessionsMonitoringIds()%0A%0Aprint%20%22Nombre%20de%20sessions%20dans%20l&rsquo;application%20%22%2BentApp%2B%22%2F%22%2BwebApp%2B%22%20%3A%20%22%2Bstr(len(MIDs))%0A%0Afor%20mid%20in%20MIDs%3A%0A%20%20%20%20%20%20%20%20print%20mid%0A%0A%20%20%20%20%20%20%20%20%0Aprint%20%22Deconnexion%20du%20serveur&#8230;%22%0Adisconnect()%0A%0A%0A%0A\u00a0\u00bb message=\u00a0\u00bbkillHttpSessions.py\u00a0\u00bb highlight=\u00a0\u00bb\u00a0\u00bb provider=\u00a0\u00bbmanual\u00a0\u00bb\/]<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Lors de tests, il est parfois utile de pouvoir supprimer toutes les sessions HTTP en cours sur un serveur. Le script WLST suivant permet de r\u00e9aliser cette op\u00e9ration :<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"footnotes":""},"categories":[1],"tags":[10,8,11],"class_list":["post-120","post","type-post","status-publish","format-standard","hentry","category-non-classe","tag-session-http","tag-weblogic-server","tag-wlst"],"_links":{"self":[{"href":"https:\/\/corsaire-consulting.fr\/blog\/index.php\/wp-json\/wp\/v2\/posts\/120","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/corsaire-consulting.fr\/blog\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/corsaire-consulting.fr\/blog\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/corsaire-consulting.fr\/blog\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/corsaire-consulting.fr\/blog\/index.php\/wp-json\/wp\/v2\/comments?post=120"}],"version-history":[{"count":3,"href":"https:\/\/corsaire-consulting.fr\/blog\/index.php\/wp-json\/wp\/v2\/posts\/120\/revisions"}],"predecessor-version":[{"id":169,"href":"https:\/\/corsaire-consulting.fr\/blog\/index.php\/wp-json\/wp\/v2\/posts\/120\/revisions\/169"}],"wp:attachment":[{"href":"https:\/\/corsaire-consulting.fr\/blog\/index.php\/wp-json\/wp\/v2\/media?parent=120"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/corsaire-consulting.fr\/blog\/index.php\/wp-json\/wp\/v2\/categories?post=120"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/corsaire-consulting.fr\/blog\/index.php\/wp-json\/wp\/v2\/tags?post=120"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}