Reputation: 116
In my project I need user authorization. Could you a hint me ways to realize a session in Cowboy server?
Upvotes: 1
Views: 2199
Reputation: 407
You could have a look at cowboy_session: https://github.com/chvanikoff/cowboy_session
Upvotes: 4
Reputation: 2593
The same way as anywhere else. If you want to just differentiate users set a cookie to something like crypto:rand_bytes()
. If you need to store some session information and is fine too put it in a cookie you can encrypt and hmac term_to_binary()
and store it in a cookie.
Upvotes: 0