Myna Sessions

5 views
Skip to first unread message

Tony Zakula

unread,
Nov 1, 2010, 10:16:26 PM11/1/10
to mynajs-general
I haven't used the session object much yet. Are there any limitations to possibly watch out for?  I was thinking about storing whole objects in the session.  Is that doable, or should I fall back to the database?

Thanks for any advice.

Tony Zakula

Mark Porter

unread,
Nov 2, 2010, 9:51:24 AM11/2/10
to mynajs-...@googlegroups.com

The biggest limitations of sessions are their lifespan and their portability. You should be prepared for session data to disappear when a user's session expires, and be aware that session data is not available in other instances. It might be good to abstract your session storage into your own get/set functions so that you can switch out your storage mechnism in the future. Another tip for future proofing is to try to only store data that can be serialized via Object.toJson(). That way if you switch to database or cluster shared maps you will be ready.

> --
> You received this message because you are subscribed to the Google Groups "MynaJS-General" group.
> To post to this group, send email to mynajs-...@googlegroups.com.
> To unsubscribe from this group, send email to mynajs-genera...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/mynajs-general?hl=en.
>
Reply all
Reply to author
Forward
0 new messages