Error: Failed to serialize user into session with Node Js, Passport and Mysql Database

I'm using Mysql Database for my Node Js Application. Using the Passport for the Authentication. This is my Passport.js File.

var passport = require('passport');
var LocalStrategy = require('passport-local').Strategy;

var mysql = require('mysql');

var connection = mysql.createConnection({
    host     : "localhost",
    user     : "root",
    password : "",
    database: "cafe"
});
connection.connect(function(err){
    if(err) throw err;

    else console.log("Passport Server Connected");
});


passport.serializeUser(function(user, done) {
    console.log("In Serialize !"+ user.ID);
    done(null, user.id);
});

// used to deserialize the user
passport.deserializeUser(function(id, done) {
    connection.query("select * from user where id = "+id,function(err,rows){
        console.log("Inside Deserialize ---> "+rows[0]);
        done(err, rows[0]);
    });
});

// https://gist.github.com/manjeshpv/84446e6aa5b3689e8b84 
// Passport with mysql database

passport.use('local-signup', new LocalStrategy({
    // by default, local strategy uses username and password, we will override with email
    usernameField : 'email',
    passwordField : 'password',
    passReqToCallback : true // allows us to pass back the entire request to the callback
},
function(req, email, password, done) {

      connection.query("select * from user where email = '"+email+"'",function(err,rows){
        console.log(rows);
        console.log("above row object");
        if (err)
            return done(err);
            if (rows.length > 0) {
            // return done(null, false, req.flash('signupMessage', 'That email is already taken.')); // Not Working
            return done(null, false, {message : 'Email Id Already Taken !'}); //Default Json Unauthorised
        } else {
            // if there is no user with that email
            // create the user

            var newUserMysql = new Object();
            newUserMysql.email    = email;
            newUserMysql.password = password; // use the generateHash function in our user model
            console.log(newUserMysql);
            var insertQuery = "INSERT INTO user ( email,password ) VALUES ('"+ email +"','"+ password +"')";
            console.log(insertQuery);
            connection.query(insertQuery,function(err,rows){
                newUserMysql.id = rows.insertId;
                if(err) throw err;
                // console.log("Error is "+ err);
                // console.log(insertQuery);
                return done(null, newUserMysql);
            });
        }   
    });
    // connection.end();
}));


passport.use('local-login', new LocalStrategy({
    // by default, local strategy uses username and password, we will override with email
    usernameField : 'email',
    passwordField : 'password',
    passReqToCallback : true // allows us to pass back the entire request to the callback
},
function(req, email, password, done) { // callback with email and password from our form
        connection.query("SELECT * FROM `user` WHERE `email` = '" + email + "'",function(err,rows){
        if (err)
            return done(err);
            if (!rows.length) {
            // return done(null, false, req.flash('loginMessage', 'No user found.')); // req.flash is the way to set flashdata using connect-flash
            return done(null, false, {message: 'No User Found! '});
        } 

        // if the user is found but the password is wrong
        if (!( rows[0].password == password )){
            // return done(null, false, req.flash('loginMessage', 'Oops! Wrong password.')); // create the loginMessage and save it to session as flashdata
            return done(null, false, {message: 'Oops! Wrong Password! '});
        }
        // all is well, return successful user
        console.log(" Inside callback of local-login -> "+rows[0]);
        return done(null, rows[0]);         
    });
}));

// module.exports;

As per my Application, Whenever I'm creating a new User in Signup Page, it's Successfully creating the User and the session is created by calling the Serialize and Deserialize function.

But when I try to LogIn the user, it's creating this Error. Only Serialize is working and Deserialize function is not called in Login Process.

However if I disable the Session with session:false, it's logging me in, but without session which I don't want.

Here's my routes file.

var express = require('express');
var router = express.Router();
async = require('async');
var csrf = require('csurf');
var passport = require('passport');
var csrfProtection = csrf();
router.use(csrfProtection);

// Profile Routes

router.get('/profile',function(req,res,next){
    res.render('user/profile');
});



// SIGN UP Routes 

router.get('/signup',function(req,res,next){
    var messages = req.flash('error');
    // console.log("In Get Route "+ messages +" is the Error"); //req.flash not working.
    res.render('user/signup', {csrfToken:req.csrfToken(), messages: messages , hasError: messages==undefined ?false :messages.length>0});
});

router.post('/signup',passport.authenticate('local-signup',{
    successRedirect:'/user/profile',
    faliureRedirect : '/user/signup',
    // faliureMessage:'Not Valid',
    faliureFlash:true,
    // session:false
}));

//Sign In
router.get('/signin',function(req,res,next){
    var messages = req.flash('error');
    // console.log("In Get Route "+ messages +" is the Error"); //req.flash not working.
    res.render('user/signin', {csrfToken:req.csrfToken(), messages: messages , hasError: messages==undefined ?false :messages.length>0});
});

router.post('/signin',passport.authenticate('local-login',{
    successRedirect:'/user/profile',
    faliureRedirect : '/user/signin',
    faliureFlash:true,
    // session:false,
}));

//Log Out   
router.get('/logout',function(req,res,next){
    req.logOut();
    res.redirect('/');
});



module.exports = router;

If I may ask, my flash isn't also working. Any Help on that will be appreciated.

PS - Please note that my Sign Up is working fine, so basically the session is being created and serialize and deserialize functions are also working fine. The problem is in Login Session only