package com.test.service;

import javax.servlet.http.HttpSession;

import com.isomorphic.rpc.RPCResponse;
import com.test.shared.User;

public class SessionService {
	public RPCResponse setSession(HttpSession session) throws Exception {
		RPCResponse response = new RPCResponse();	
		//this is session time-out time in minutes
		int timeout = 1;		
		timeout = timeout * 60;
		session.setAttribute("user", new User("user", "name", "surname", "password"));
		session.setMaxInactiveInterval(timeout);
		response.setStatus(RPCResponse.STATUS_SUCCESS);	
		return response;
	}
	
}
