On Mon, Jan 24, 2011 at 8:02 AM, mark <
marks...@gmail.com> wrote:
> Hi,
>
> I have a login/registration system working like this:
> - when a user registers, I have a db record like this
> {_id: 'BaDDyvSiAoUrXGgsHiV3yiT.gYS8qDKyUo4Hk2L/
> x90VVR13It2L2pNK0hVaTrjyAp0', "lastAccess" :
> NumberLong("1295854752511"), user: {firstname: 'billy', lastname:
> 'bob', location: 'usa'} }
> - that info is all in the session store, so it's also in req.session.
> ie. req.session.user.firstname = 'billy' and req.sessionID =
> 'BaDDyv....'
>
> Now I'm trying to write the log out function. I want to change the
> sessionID in the response, and leave the _id in the db the same. I
> tried req.session.regenerate() , but that also clobbers the other info
> I'm storing in the session (ie. req.session.user). Is there a way to
> change the user's sessionID without clobbering the saved entry in the
> session store?
- cj.