cowboy: session state and connection timeout
Lloyd R. Prentice
Tue Mar 2 15:56:13 CET 2021
A shameless plug for our book Build it with Nitrogen:
It shows how to build Erlang-based sites with Cowboy and other servers, mnesia and other dbs, how to manage state, and much much more.
Best of success with your project,
Sent from my iPad
> On Mar 2, 2021, at 4:05 AM, Roger Lipscombe <roger@REDACTED> wrote:
> On Tue, 2 Mar 2021 at 04:14, jdmeta <jdmeta@REDACTED> wrote:
>> it's still not completely clear to me how to maintain session state even for http in cowboy.
>> this is a well-known function in most web serving frameworks.
>> do i have to roll-my-own?
> Cowboy isn't a web *framework*; it's a web *server*. There are several
> web frameworks built on top of it. The most popular, if you're
> prepared to use Elixir, is Phoenix: https://www.phoenixframework.org/.
> For Erlang. I think that the one that's most actively maintained is
> https://nitrogenproject.com/. There are others.
> If you don't want to use one of those, and if you want session
> support, you'll have to find a library that implements it, or
> implement your own. There's some documentation about using cookies
> with cowboy here:
> https://ninenines.eu/docs/en/cowboy/2.5/guide/cookies/, but -- if you
> want server-side sessions -- you'll need to combine that with a
> session store, probably in ETS. Searching online for "cowboy session"
> returns two Erlang libraries, both kinda old, but you can use them as
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the erlang-questions