Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ttl和keepAlive功能存在bug #251

Open
0ui0 opened this issue Oct 15, 2024 · 0 comments
Open

ttl和keepAlive功能存在bug #251

0ui0 opened this issue Oct 15, 2024 · 0 comments
Labels
bug Bug or defect

Comments

@0ui0
Copy link

0ui0 commented Oct 15, 2024

Runtime

nodejs chrome

Runtime version

node 20.18.0

Module version

12.0.1

Last module version without issue

No response

Used with

No response

Any other relevant information

No response

What are you trying to achieve or the steps to reproduce?

如果没有启用ttl之前用户登录写入了一条cookie,启用ttl和keepalive之后,会再写入一条cooke且不会清除上一条cookie,此时会存在两条cookie,且会读取到旧的cookie导致用户无法登录,keepAlive写入之前可能要unstate一下
keepalive还存在一个问题,如果用户a登出,再登录用户b,结果登录的还是用户a。因为异步响应有延迟,可能导致a登出后清除的cookie被服务器延迟响应的keepAlive重新写入,于是a又被登录了

"If a user logs in and writes a cookie before enabling ttl, after enabling ttl and keepAlive, another cookie will be written without clearing the previous one, resulting in two cookies being present. This can lead to the old cookie being read, preventing the user from logging in. It might be necessary to unset the previous state before writing with keepAlive.

There is also an issue with keepAlive: if user A logs out and then user B logs in, user A remains logged in. This is because the asynchronous response delay can cause the cookie cleared upon A's logout to be overwritten by a delayed server response for keepAlive, effectively logging user A back in again."

@0ui0 0ui0 added the bug Bug or defect label Oct 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Bug or defect
Projects
None yet
Development

No branches or pull requests

1 participant