ExampleApp/src/com/altinn/apps/fisher/net/CookieHelper.java
/**
	 * Update the cookie if we get refresh token while accessing web-service
	 * if in HttpResponse there is any 'Location' header and task execution is kind of 
	 * post-message in that case here we are parsing message-id from location header and returned
	 * @param response
	 * @return
	 */
Update the cookie if we get refresh token while accessing web-service
if in HttpResponse there is any 'Location' header and task execution is kind of
post-message in that case here we are parsing message-id from location header and returned
@param response
@return
Update the cookie if we get refresh token while accessing web - service if in HttpResponse there is any ' Location ' header and task execution is kind of post - message in that case here we are parsing message - id from location header and returned @param response @return
public String updateCokkieFromHeaders(HttpResponse response){
		String msgReturn = null; 
		if(response != null){
			System.out.println("****** HEADER START *********");
			Header[] headers = response.getAllHeaders();
			for(Header header:headers){
				System.out.println( header.getName() + ":"+header.getValue());
				if(header.getName().equalsIgnoreCase("Set-Cookie")){
					updateCookie(header.getValue(),true);
				}
				if(header.getName().equalsIgnoreCase("Location")){
					int index = header.getValue().lastIndexOf('/');
					msgReturn = header.getValue().substring(index+1);
				}
			}
			System.out.println("****** HEADER END *********");
		}
		return msgReturn;
	}
public String updateCokkieFromHeaders ( HttpResponse response ) { String msgReturn = null ; if ( response != null ) { System . out . println ( "****** HEADER START *********" ) ; Header [ ] headers = response . getAllHeaders ( ) ; for ( Header header : headers ) { System . out . println ( header . getName ( ) + ":" + header . getValue ( ) ) ; if ( header . getName ( ) . equalsIgnoreCase ( "Set-Cookie" ) ) { updateCookie ( header . getValue ( ) , true ) ; } if ( header . getName ( ) . equalsIgnoreCase ( "Location" ) ) { int index = header . getValue ( ) . lastIndexOf ( '/' ) ; msgReturn = header . getValue ( ) . substring ( index + 1 ) ; } } System . out . println ( "****** HEADER END *********" ) ; } return msgReturn ; }
Update the cookie if we get refresh token while accessing web-service
 if in HttpResponse there is any 'Location' header and task execution is kind of
 post-message in that case here we are parsing message-id from location header and returned
 @param response
 @return
Update the cookie if we get refresh token while accessing web - service if in HttpResponse there is any ' Location ' header and task execution is kind of post - message in that case here we are parsing message - id from location header and returned @param response @return
//here location header get returned //expected like "Location: https://tt02.altinn.basefarm.net/api/910463152/messages/b1110209" //Here we need to return meesage-id b1110209