private ServiceRefAmp sessionImpl ( String address ) { if ( ! address . startsWith ( "session:" ) || ! address . endsWith ( "/" ) ) { throw new IllegalArgumentException ( address ) ; } String sessionId = cookie ( "JSESSIONID" ) ; if ( sessionId == null ) { sessionId = generateSessionId ( ) ; cookie ( "JSESSIONID" , sessionId ) ; } return services ( ) . service ( address + sessionId ) ; }
Find or create a session cookie as the session id and find or create a session with the generated address .