how do u do cookie sessions or cookies data sending in coap?
hiqsociety opened this issue · comments
HIQ Society commented
how do u do cookie sessions or cookies data sending in coap?
any example on this? pls dont suggest use etag?
Jozef Kralik commented
It depends on how big the cookie is. If it's a few bytes, you can use option URI-Query (max 255 bytes) with value "cookie=[data]" - all data must be string format. In this case, first you need to transfer the cookie to the server via the body and then the server needs to associate it with the socket. After that, for each request from a client, the server appends stored cookie.
Kol Influence commented
- what if it's not just a few bytes just wondering.
- also, what's a good way to do this cookie? since everything is "new", was wondering if there are better options for this cookie thing.
Jozef Kralik commented
- 255 Bytes with keyword
- Only if you need to forward cookie: You need to create a session at the server size and associate cookie there. Similar as is mentioned in OCF Specification - Sign in operation via
oic/sec/session
resource. And after that you will append this cookie to any request from the client to server.