Closed jackmuskopf closed 7 months ago
In this PR https://github.com/ca98am79/connect-dynamodb/pull/83/files changes everything from ms to seconds, which is correct, since DynamoDB TTL uses epoch time in seconds. However, you can see that sess.cookie.maxAge
does not change in this PR, which it should because the Express session cookie maxAge is specified in ms. It needs to be converted to seconds to work with DynamoDB TTL.
I am also running this patch now, let me know if anything needs clarified for fixed. Happy to look at it more.
Thanks, Jack
The PR is actually wrong gents. The update should be this:
? now + sess.cookie.maxAge / 1000 : now + oneDayInSeconds;
The PR is actually wrong gents. The update should be this:
? now + sess.cookie.maxAge / 1000 : now + oneDayInSeconds;
Isn't that what the PR has? The : now + oneDayInSeconds;
is just on the next line (which was not changed)
thank you!
@jackmuskopf @tfrancois @ca98am79
This patch include a issue. Because cookie max-age expected second (is not mill second) by cookie specification.
A cookie expired time become multiply thousandfold If this patch used with cookie.maxAge option.
The Max-Age attribute indicates the maximum lifetime of the cookie, represented as the number of seconds until the cookie expires. refs : https://httpwg.org/specs/rfc6265.html#max-age-attribute
I've noticed something. It seems that express-session sets “cookie.maxAge” in mill seconds while next-session sets “cookie.maxAge” in seconds. So the problem caused in my application when upgraded connect-dynamodb@3.0.3 from connect-dynamodb@3.0.2. However, this may not be a connect-dynamodb problem.
refs: https://github.com/hoangvvo/next-session/issues/369 refs: https://github.com/hoangvvo/next-session/pull/386
Addresses this issue: https://github.com/ca98am79/connect-dynamodb/issues/86
Also changes error handling for
DescribeTable
to assume the table does not exist only if the error isResourceNotFoundException