Delete old _ah_SESSION entities

Image representing Google App Engine as depict...

GAE has not input automatic removal service for expired _ah_SESSION entities. I found the following way, solve by examining sessionCleanupServlet. It delete expired session using cron jobs. The App Engine Cron Service allows you to configure regularly scheduled tasks that operate at defined times or regular intervals.

First time, I decided not to post this in my blog coz all are copied. It is meaningless. But I did not find this configuration in official site. So, I copied this from original as a note. That’s all. Be happy with my note. 😀

We’ll add this to code.google.com shortly. In the meantime,

here’s what you can do:

In web.xml:

<web-app…>

<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>

<security-constraint>

<web-resource-collection>

<web-resource-name>session-cleanup</web-resource-name>

<url-pattern>/_ah/sessioncleanup</url-pattern>

</web-resource-collection>

<auth-constraint>

<role-name>admin</role-name>

</auth-constraint>

</security-constraint>

</web-app>

————————-

And in cron.xml:

<cronentries>

<cron>

<url>/_ah/sessioncleanup?clear</url>

<description>Clean up sessions</description>

<schedule>every day</schedule>

</cron>

</cronentries>

Pasted from <http://groups.google.com/group/google-appengine-java/browse_thread/thread/4f0d9af1c633d39a/875921846a160b52?lnk=gst&q=sessionCleanupServlet+%23875921846a160b52&pli=1>

One thought on “Delete old _ah_SESSION entities

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s