1   /*
2    * Apache License
3    * Version 2.0, January 2004
4    * http://www.apache.org/licenses/
5    *
6    * Copyright 2008 by chenillekit.org
7    *
8    * Licensed under the Apache License, Version 2.0 (the "License");
9    * you may not use this file except in compliance with the License.
10   * You may obtain a copy of the License at
11   *
12   * http://www.apache.org/licenses/LICENSE-2.0
13   */
14  
15  package org.chenillekit.access.pages;
16  
17  import org.apache.tapestry5.ioc.annotations.Inject;
18  import org.apache.tapestry5.services.Request;
19  import org.apache.tapestry5.services.Session;
20  
21  /**
22   * Page which logs the user out of the application.
23   *
24   * @version $Id: Logout.java 380 2008-12-30 10:21:52Z mlusetti $
25   */
26  public class Logout
27  {
28  	@Inject
29  	private Request request;
30  
31  	final public void beginRender()
32  	{
33  		// logout
34  		Session session = request.getSession(false);
35  		
36  		if (session != null)
37  			session.invalidate();
38  	}
39  }