Im using Struts2 running in google app engine.
User can use their google and facebook account to login to the site. When a user login, i have:
session.put("email", email);
When a user log-out, I have
session.remove("email");
In Struts2 Action, I have the following:
public class ChapterAction extends ActionSupport implements SessionAware{
private static final long serialVersionUID = 1L;
private Map<String, Object> session;
public Map<String, Object> getSession() {
return session;
}
public void setSession(Map<String, Object> session) {
this.session = session;
}
public String add() throws Exception{
String email = (String) session.get("email");
if ( email == null)
return LOGIN;
//business logic here
return SUCCESS;
}
}
Please critic my code. Is the above usage of session OK and secure?
Thanks