is there some simple example how to use cookies or sessions in towerjs? I read about Connect Middleware, but I have no experience with it (and unfortunately with node.js also).
If examples are not available I will be grateful for any tips too.
Marcin
Cookies
From the TowerJS source code here, the controller has these properties:
@request
@response
@cookies
(which is just a shortcut for@request.cookies
)@session
(which is just a shortcut for@request.session
)Hence to set cookies you can follow express documentation here
For example this set cookie 'rememberme'
And to get the cookie
Session
As for session, looks like it's just connect in memory session. See source code here https://github.com/viatropos/tower/blob/master/src/tower/server/application.coffee#L39
So you can just use it like:
or
Ok hope that helps...