sessionStorage Plugin

Hi guys

can anybody tell me the pros and cons of using sessionStorage plugin
vs regular session variable assignment

It basically removes the direct dependency from the session scope and replaces it with an object that can be mocked when you want to do unit testing..
In my opinion, the rest is pretty philosophical. Instead of breaking encapsulation and reaching out directly to an external scope you decorate the session scope so your methods are self-sufficient and de-coupled from their environment. In the instance of CookieStorage, the facade also supplies you with built-in serialization and encryption which makes life easier for you.



The plugin also handles locking for you.

Something to consider with using sessions or the sessionstorage plugin in your handlers is that you are tied to the session scope. You may want to consider calling a service from your handler which then calls the sessionplugin or session scope you if you want to change from session to say cookie you only have to change it in one place in your service layer.

– sent by a little green robot