This function takes the following parameters:
Pointer to the cookie.
Pointer to the buffer where the encoded cookie will be stored.
The size of the buffer.