Session store

51 views
Skip to first unread message

mike

unread,
Oct 30, 2010, 8:52:26 PM10/30/10
to Express
When I use connect-redis's RedisStore for my session some functions on
objects attached to my session are no longer there once the session
has been stored in Redis then retrieved. When I use the MemoryStore my
functions stay in tact.

Do I need to revitalize the session objects manually? What are other
people doing?

Thanks, Mike

vision media [ Tj Holowaychuk ]

unread,
Oct 30, 2010, 9:48:02 PM10/30/10
to expre...@googlegroups.com
well you need to make sure that you extend the prototype of RedisStore and not connect.session.MemoryStore, if that is what you are doing


--
You received this message because you are subscribed to the Google Groups "Express" group.
To post to this group, send email to expre...@googlegroups.com.
To unsubscribe from this group, send email to express-js+...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/express-js?hl=en.




--
Tj Holowaychuk
Vision Media
President & Creative Lead

mike

unread,
Oct 30, 2010, 9:53:30 PM10/30/10
to Express
I'm using RedisStore directly, not changing the prototype at all. I
fear my misunderstanding is deep... continuing to dig but I welcome
any further input. Thanks.

On Oct 30, 9:48 pm, "vision media [ Tj Holowaychuk ]" <t...@vision-
media.ca> wrote:
> well you need to make sure that you extend the prototype of RedisStore and
> not connect.session.MemoryStore, if that is what you are doing
>
>
>
>
>
>
>
>
>
> On Sat, Oct 30, 2010 at 5:52 PM, mike <mikebannis...@gmail.com> wrote:
> > When I use connect-redis's RedisStore for my session some functions on
> > objects attached to my session are no longer there once the session
> > has been stored in Redis then retrieved. When I use the MemoryStore my
> > functions stay in tact.
>
> > Do I need to revitalize the session objects manually? What are other
> > people doing?
>
> > Thanks, Mike
>
> > --
> > You received this message because you are subscribed to the Google Groups
> > "Express" group.
> > To post to this group, send email to expre...@googlegroups.com.
> > To unsubscribe from this group, send email to
> > express-js+...@googlegroups.com<express-js%2Bunsubscribe@googlegrou ps.com>
> > .

vision media [ Tj Holowaychuk ]

unread,
Oct 30, 2010, 10:04:07 PM10/30/10
to expre...@googlegroups.com
not sure I understand what the problem is

To unsubscribe from this group, send email to express-js+...@googlegroups.com.

For more options, visit this group at http://groups.google.com/group/express-js?hl=en.

Shripad K

unread,
Oct 31, 2010, 12:17:06 AM10/31/10
to expre...@googlegroups.com
An example of the reply? What kind of data are you storing in redis/couch?

On Sun, Oct 31, 2010 at 9:42 AM, mike <mikeba...@gmail.com> wrote:
Sorry, I'll try to say it better... I wanted to keep complex objects
in the session but I find when they're saved to Redis (or Couch) they
come back with data attributes but their methods are gone. Trying my
best but very new to this. Thanks Tj. -Mike

On Oct 30, 10:04 pm, "vision media [ Tj Holowaychuk ]" <t...@vision-

mike

unread,
Oct 31, 2010, 12:12:38 AM10/31/10
to Express
Sorry, I'll try to say it better... I wanted to keep complex objects
in the session but I find when they're saved to Redis (or Couch) they
come back with data attributes but their methods are gone. Trying my
best but very new to this. Thanks Tj. -Mike

On Oct 30, 10:04 pm, "vision media [ Tj Holowaychuk ]" <t...@vision-

vision media [ Tj Holowaychuk ]

unread,
Oct 31, 2010, 1:20:50 AM10/31/10
to expre...@googlegroups.com
you cant save functions, with mongo you could, but with redis and most other stores its just json

Maciej Dziardziel

unread,
Oct 31, 2010, 1:45:53 AM10/31/10
to expre...@googlegroups.com
Write your class able to initialize with data from redis and add any
logic there. Storing functions in persistent storage is bad idea
anyway - what will you do when code of such function will change?

mike

unread,
Oct 31, 2010, 1:50:31 AM10/31/10
to Express
Thanks for straightening me out. -Mike
Reply all
Reply to author
Forward
0 new messages