Don Lino
Don Lino

Reputation: 116

How to realize user authorization and session mechanism in Cowboy?

In my project I need user authorization. Could you a hint me ways to realize a session in Cowboy server?

Upvotes: 1

Views: 2199

Answers (2)

Mustafa
Mustafa

Reputation: 407

You could have a look at cowboy_session: https://github.com/chvanikoff/cowboy_session

Upvotes: 4

Dmitry Belyaev
Dmitry Belyaev

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

Related Questions