cowboy: session state and connection timeout

Lloyd R. Prentice lloyd@REDACTED
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?
> Yes.
> 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:
> For Erlang. I think that the one that's most actively maintained is
> 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:
>, 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
> inspiration.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the erlang-questions mailing list