Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
假设节点快速会话保存在应用程序中(意味着它们不一定从传入访问req),如何检查这些会话中的任何一个是否已过期?什么是正确的测试?
req
假设您在会话中保存了用户名。req.session.name='pankti'当您尝试获取它时,如果它未定义,则它已过期。req.session.name == 'undefined'
req.session.name='pankti'
req.session.name == 'undefined'