Can I disable session handling completely?

20 views
Skip to first unread message

Klaus Baumecker

unread,
Dec 18, 2014, 4:18:17 AM12/18/14
to socket...@googlegroups.com
I'm running two types of servers: one is a web server, accepting browser connections and doing web-socket communication. The other one one is headless and accepts HTTP POST messages. Both servers are connected via redis pub/sub implemented by socket stream.

The first server needs sessions, that's clear. But the second (headless) one does not. All wiring of data is based on URL params. However I''m using ss for the second server two, each HTTP POST creates a new session, which is not necessary. Is there a way to switch session creation off?

Regards,
klaus

Klaus Baumecker

unread,
Dec 18, 2014, 5:10:01 AM12/18/14
to socket...@googlegroups.com
It seems like prepending my own middleware (using ss.http.middleware.prepend() ) before the auto-loaded middleware anwers this question. If one of my routes match, and my route is not calling next(), the processing chain stops there.

Can someone confirm this?

Henrik Vendelbo

unread,
Dec 24, 2014, 7:24:23 AM12/24/14
to socket...@googlegroups.com
I am working on a feature branch in this area where you will be able to even set up your own strategy for the middleware. I expect to merge it soon.

I would consider supporting a setting like `ss.http.set({ sessionMiddleware:false })`. However it might be better to have a couple of strategies to switch between. For instance
* Minimal (just static and assets)
* Sessionless (no cookie parser and session handling)
* Default (as it is)

You would be able to set a strategy by `ss.http.set({ strategy: 'minimal' })`.

What you suggest about prepending makes sense.

Klaus Baumecker

unread,
Jan 14, 2015, 9:51:43 AM1/14/15
to socket...@googlegroups.com
Hi Henrik,

sounds great. Do you envision to create configurable strategies? In a simple form this would boil down to a list of midlleware functions assigned to a strategy name.

/klaus

Henrik Vendelbo

unread,
Apr 5, 2015, 6:39:46 AM4/5/15
to socket...@googlegroups.com
I did implement that, and it is in the 0.3.12 release
Reply all
Reply to author
Forward
0 new messages