See the comment from above. This may be rewritten to either string:tokens(Cookie, ",") or <<ExpTime:10/binary,Hmac:16/binary,Data/binary>> = Cookie.

IMO, the latter is a better way, since it operates with binaries and doesn't involve commas overhead.