Skip to content

Commit 739049f

Browse files
committed
Added a cronjob that will delete expired sessions every 15 minutes.
1 parent 50b7376 commit 739049f

File tree

3 files changed

+29
-5
lines changed

3 files changed

+29
-5
lines changed

src/main/webapp/WEB-INF/appengine-web.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,5 @@
33
<application>blindepoule</application>
44
<version>2</version>
55
<threadsafe>true</threadsafe>
6+
<sessions-enabled>true</sessions-enabled>
67
</appengine-web-app>

src/main/webapp/WEB-INF/cron.xml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<cronentries>
3+
<cron>
4+
<url>/_ah/sessioncleanup?clear</url>
5+
<description>Clean up sessions</description>
6+
<schedule>every 15 minutes</schedule>
7+
</cron>
8+
</cronentries>

src/main/webapp/WEB-INF/web.xml

Lines changed: 20 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,26 @@
11
<?xml version="1.0" encoding="utf-8"?>
2-
<!--<!DOCTYPE web-app PUBLIC
3-
"-//Oracle Corporation//DTD Web Application 2.3//EN"
4-
"http://java.sun.com/dtd/web-app_2_3.dtd">-->
5-
<!--<web-app xmlns="http://java.sun.com/xml/ns/javaee" version="2.5">
6-
</web-app>-->
72
<web-app xmlns="http://java.sun.com/xml/ns/javaee" version="3.1">
83
<welcome-file-list>
94
<welcome-file>index.jsp</welcome-file>
105
</welcome-file-list>
6+
7+
<servlet>
8+
<servlet-name>_ah_sessioncleanup</servlet-name>
9+
<servlet-class>com.google.apphosting.utils.servlet.SessionCleanupServlet</servlet-class>
10+
</servlet>
11+
12+
<servlet-mapping>
13+
<servlet-name>_ah_sessioncleanup</servlet-name>
14+
<url-pattern>/_ah/sessioncleanup</url-pattern>
15+
</servlet-mapping>
16+
17+
<security-constraint>
18+
<web-resource-collection>
19+
<web-resource-name>Sessions Removal</web-resource-name>
20+
<url-pattern>/_ah/sessioncleanup</url-pattern>
21+
</web-resource-collection>
22+
<auth-constraint>
23+
<role-name>admin</role-name>
24+
</auth-constraint>
25+
</security-constraint>
1126
</web-app>

0 commit comments

Comments
 (0)