Express change session every request

后端 未结 5 1915
夕颜
夕颜 2021-02-11 01:52

I have a function to login

app.post(\'/doLogin\', function(req,res){
        db.users.findOne({username: req.body.username}, function(err, user) {
            if         


        
5条回答
  •  萌比男神i
    2021-02-11 02:23

    All answers so far are helpful but don't directly solve the issue with using secure:true.

    In order to use secure:true you must have support for https for secure cookies. Additionally you must use withCredentials for cross-site access control. withCrendentials:true has no impact on same-site request.

    https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest/withCredentials

    Majority of libraries support this parameter in their configurations such as angular and dropzone.

提交回复
热议问题