Appengine明确过期会话,但需要管理员权限才能访问https:// [domain] / _ah / sessioncleanup?clear

时间:2016-06-16 10:15:09

标签: google-app-engine session

项目工作在Appengine,我想清除过期的会话,请遵循以下文档: https://groups.google.com/forum/#!msg/google-appengine-java/Tw2a8cYz05o/UgsWaoQhWYcJ

Web.xml中

<servlet>
        <servlet-name>_ah_sessioncleanup</servlet-name>
        <servlet-class>com.google.apphosting.utils.servlet.SessionCleanupServlet</servlet-class>
    </servlet>

    <servlet-mapping>
        <servlet-name>_ah_sessioncleanup</servlet-name>
        <url-pattern>/_ah/sessioncleanup</url-pattern>
    </servlet-mapping>

    <!-- Default page to serve -->
    <welcome-file-list>
        <welcome-file>index.html</welcome-file>
    </welcome-file-list>

    <security-constraint>
        <web-resource-collection>
            <web-resource-name>session-clean-up</web-resource-name>
            <url-pattern>/_ah/sessioncleanup</url-pattern>
        </web-resource-collection>
        <auth-constraint>
            <role-name>admin</role-name>
        </auth-constraint>
    </security-constraint>

cron.xml

<?xml version="1.0" encoding="UTF-8"?>
<cronentries>
  <cron>
    <url>/_ah/sessioncleanup?clear</url>
    <description>Clean up sessions</description>
    <schedule>every 15 minutes</schedule>
  </cron>
</cronentries>

但是日志显示:

09:55:00.957 GET 403 94 B 2 ms AppEngine / _ah / sessioncleanup?clear

回应403

enter image description here

任何人都可以帮助我吗?感谢。

0 个答案:

没有答案