Handling Session ID with Spring
        Posted  
        
            by Max
        on Stack Overflow
        
        See other posts from Stack Overflow
        
            or by Max
        
        
        
        Published on 2010-05-29T07:52:33Z
        Indexed on 
            2010/05/29
            8:12 UTC
        
        
        Read the original article
        Hit count: 304
        
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.
© Stack Overflow or respective owner