1.10.2. Cookies in Client Mode

On the client side you have to do the following to benefit form session management with cookies:


  TcpIpConnection conn (false, host, port);
  HttpProtocol prot(&conn);

  prot.setAcceptCookies(true);  1

  prot.setClientCookie("cookie-test=123"); 2

  if (prot.hasCookie())
    prot.getCookie(); 3

1

Enable cookie managent. Otherwise cookies are completely ignored.

2

Add a cookie to the request if available.

3

Check for incoming cookie information and store for later re-use.