Hello. Faced a problem on the client-server application. Upon successful client authorization (Post-request) - the server generates the sessionID and sends it to the client. How to use this ID to constantly transfer it to the server? For a web client, this parameter is passed to coockie. How to implement it in a similar way in the application?

  • Pass the authorization token to a query-parameter or header. - Nofate
  • I do not have the ability to change the server. Is there a standard solution to this situation? I can send without problems, the question is whether this server will read correctly. - Jorik
  • 3
    Just cook and send back to the server. You do not know how to extract the cookie from the http server response and insert it into the http request? - Sergey
  • How to extract - I know. How to send - no. - Jorik

1 answer 1

HttpURLConnection newConn = (HttpURLConnection) newUrl.openConnection(); newConn.setRequestProperty("Cookie",SessionID);