This function returns one of the following values of the am_status_t enumeration (defined in the <am_types.h> header file):
If the cookie was successfully encoded and stored.
If the cookie or buffer is NULL..
If the defined size is smaller than the encoded value.
If any other error occurred.