Handling Session ID with Spring
- by Max
Hi,
I'm trying to build a Spring server for GWT (you can think of it as of Javascript AJAX client). But I can't decide on one point of architecture. How should session be created and used?
The obvious easiest way - is to use HTTP sessions (cookies and stuff). Looks fine, but I think that sending session ID separate from the headers would be better (SOAP style).
So, what is better:
getMyPetsName(String sessionID, int petID) or getMyPetsName(int petID) + session ID through HTTP header (cookies or something).
Another question is, if I use the first way (which I like more) - how do I handle session in Spring? I'm really newbie in Spring, and googling did not help. What I mean is:
String getMyPetsName(String sessionID, int petID) {
Session s = someWayToGetItById(sessionID);
}
Thanks in advance.