ExpressJS with PassportJS: Session handling

I am using passportJS for authentication. My configuration is as below:

app.use(express.bodyParser({uploadDir:'/tmp'}));
app.use(express.urlencoded());
app.use( express.cookieParser() );
app.use(express.session({ secret: 'keyboard cat' }));
app.use(passport.initialize());
app.use(passport.session());
app.use(app.router);
app.use(express.static(__dirname + '/public'));

Now from the login page to the next page I can access the req.user.username variable.

However let's say I define a new variable for the session, ie req.session.x , it doesn't persist across the web application.

Now, to make things worse, it's working in my development machine but not in the deployment environment. I've compared the nodejs, local and global plugins version, they are identical.

Anything else I should check? Thanks.

My passport code as below;

//Login 
app.get('/login',login.login);
app.post('/login',passport.authenticate('local', {
    successRedirect : '/loginSuccess',
    failureRedirect : '/loginFailure'
    }
));

app.get('/loginSuccess',login.success);
app.get('/loginFailure',login.fail);

passport.serializeUser(function(user, done) {
    done(null, user);
});

passport.deserializeUser(function(user, done) {
    done(null, user);
});

var mongoose = require('mongoose/');
mongoose.connect('mongodb:<>');
var Schema = mongoose.Schema;
var UserDetail = new Schema({
    username : String,
    password : String
}, {
    collection : 'user'
});
var UserDetails = mongoose.model('user', UserDetail);

passport.use(new LocalStrategy(function(username, password, done) 
{
    process.nextTick(function() {    
        UserDetails.findOne({
            'username' : username,},
        function(err,user) {
            if (err) {
                return done(err);
            }
            if (!user) {
                return done(null,false);
            }
            if (user.password != password) {
                return done(null,false);
            }
            return done(null, user);
         });
     });
}));