Dealing with login/logout and session handling making use of spring security programmatically.