public String getSessionID ( ) { String sid = null ; String jsid = null ; List < Cookie > cookies = this . sessioncontext . getCookieStore ( ) . getCookies ( ) ; for ( Cookie cookie : cookies ) { if ( cookie . getName ( ) . equalsIgnoreCase ( "sessionid" ) ) sid = cookie . getValue ( ) ; if ( cookie . getName ( ) . equalsIgnoreCase ( "jsessionid" ) ) jsid = cookie . getValue ( ) ; } return ( sid == null ? jsid : sid ) ; }
Extract the sessionid cookie value