Tuesday 6 June 2017

How to use cookies, doubts PASSPORT-LOCAL

I have doubt about the use of cookies in nodejs, this using passport-local, session-express and cookie-parse, but I do not understand very well, I have seen that they configure cookies with a store and I do not understand anything that happens if you use cokie Without store? Someone can explain me well that store is better

Then I leave a part of my code In app.js

app.use(favicon());
    app.use(logger('dev'));
    app.use(cookieParser());
    app.use(bodyParser.json());
    app.use(bodyParser.urlencoded({ extended: false }));

    app.use(express.static(path.join(__dirname, 'public')));

     app.use(session({secret  : 'wqeqweqw',
         //cookie  : { maxAge  : new Date(Date.now() + (60 * 1000 * 30)) }
    }));

     app.use(passport.initialize());
     app.use(passport.session());
     app.use(flash());

How can I use cookie with a store? And what if I do not use store?



via M. Node

No comments:

Post a Comment