Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

session.id not initialized properly #183

Closed
canoeberry opened this issue Jan 5, 2011 · 1 comment
Closed

session.id not initialized properly #183

canoeberry opened this issue Jan 5, 2011 · 1 comment

Comments

@canoeberry
Copy link

If your browser comes in with a session cookie, but that cookie is long gone (you restarted the server and were using memory cookies), a new session object is created where

req.session.id = <old cookie from browser>
req.sessionID = <new ID that should have been stored in session.id>

That's because the generate() function looks like this:

    var generate = store.generate = function(){
        var base = utils.uid();
        var sessionID = base + "." + hash(base);
        req.session = new Session(req, sessionID);
        req.sessionID = sessionID;
    };

and passing in sessionID to the Session constructor does nothing with sessionID because it's not an object. The Session constructor initializes session.id with req.sessionID, but generate doesn't set req.sessionID until after the Session constructor.

@tj
Copy link
Member

tj commented Jan 5, 2011

Fixed session.id issue. Closed by 7840744

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants