Request Cookies have N/A Set for Cookie Attirbutes
<p>I am working on fixing my Cloudfront (CF) Cookie Setup within my ExpressJS application and have had on and off success with the cookies successfully being set and recognized by my Cloudfront distribution, but I noticed that when I am unsuccessful (Bulk of the time) with accessing content from the distribution, it seems to potentially be due to the CF <code>Request Cookies</code> having an <code>N/A</code> value for Domain, Path and Expires. How do <code>Request Cookies</code> work? Within ExpressJS, there is the ability to <code>Set-Cookie</code>, which is what I do and is correctly displayed in the <code>Response Cookies</code> section, but I'm not sure what is causing the <code>Request Cookies</code> to appear in the start they do. I also noticed the <code>CloudFront-Signature</code> cookie is different between the request and response cookie. Could this cause this problem?</p>

<p>Screenshot of my HTTP request on page load</p>

<p><a href="https://i.stack.imgur.com/ynjyV.png" rel="nofollow"><img src="https://i.stack.imgur.com/ynjyV.png" alt="HTTP"></a></p>

<p>Code setting cookie:</p>

<pre><code>var express = require('express');
var router  = express.Router();
var session = require('express-session');
var passport = require('passport');
var crypto = require('crypto');
var moment = require('moment');
var path = require('path');
var fs = require('fs');
var cf = require('aws-cloudfront-sign');
var metaTags = require('./meta-routes');

router.use('/app', isLoggedIn, require('./app-routes'));

var cfPK = path.join(__dirname + process.env.CF_PRIVATE_KEY);

var cfOptions = {
    keypairId: process.env.CF_KEY_ID,
    expireTime: null,
    privateKeyPath: cfPK
}

var signedCookies = cf.getSignedCookies(process.env.CF_CNAME, cfOptions);

function isLoggedIn(req, res, next) {

    if (req.isAuthenticated())

        for(var cookieId in signedCookies) {
            res.cookie(cookieId, signedCookies[cookieId], { httpOnly: true, domain: process.env.DOMAIN_NAME || 'localhost', secure: true });
        }

        return next();
    res.redirect('/login');
}
</code></pre>