Express.js + Google Chrome extension : is session storage possible?
I'm working on a Google Chrome extension with a popup, in which I load a page from a node.js + express.js server. The page I load changes depending on the status of the `req.session.user` in this way:

    app.get('/', function(req, res){
    	if(req.session.user){
    		res.render(__dirname + '/pages/base.jade', {});
    	}
    	else{
    		res.render(__dirname + '/pages/login_register.jade', {});
    	}
    });

If `req.session.user` is null I send a page in which the user can do the login or register. If he/she does a login, this is what happens in the server:

    app.post('/login', function(req, res){
    	var user = {};
    	user.username = req.body.username;
    	user.password = req.body.password;
    	checkLogin(user, function(foundUser){
    		//login correct
    		console.log("login!");
    		req.session.user = foundUser;
    		res.render(__dirname + '/pages/base.jade', {
    		});
    	});
    });

So if the user logs in correctly `req.session.user` should be set with the credentials of the current user. The problem is that once I log in and then close the popup of the Chrome extension, whenever I reopen it I still receive the login page.

My question is: does the popup supports session storage in the express.js server? If yes, then there is something wrong with my code, can anyone point out what am I doing wrong? Thanks.
Express.js + Google Chrome extension : is session storage possible?
===

I'm working on a Google Chrome extension with a popup, in which I load a page from a node.js + express.js server. The page I load changes depending on the status of the `req.session.user` in this way:

    app.get('/', function(req, res){
    	if(req.session.user){
    		res.render(__dirname + '/pages/base.jade', {});
    	}
    	else{
    		res.render(__dirname + '/pages/login_register.jade', {});
    	}
    });

If `req.session.user` is null I send a page in which the user can do the login or register. If he/she does a login, this is what happens in the server:

    app.post('/login', function(req, res){
    	var user = {};
    	user.username = req.body.username;
    	user.password = req.body.password;
    	checkLogin(user, function(foundUser){
    		//login correct
    		console.log("login!");
    		req.session.user = foundUser;
    		res.render(__dirname + '/pages/base.jade', {
    		});
    	});
    });

So if the user logs in correctly `req.session.user` should be set with the credentials of the current user. The problem is that once I log in and then close the popup of the Chrome extension, whenever I reopen it I still receive the login page.

My question is: does the popup supports session storage in the express.js server? If yes, then there is something wrong with my code, can anyone point out what am I doing wrong? Thanks.