TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

Ask HN: Should I associate session data with an access token?

1 点作者 dustinfarris超过 9 年前
Trying to figure out a best practice here. My REST API is working well, but there is one small piece of data (other than the authenticated user) that I need to just persist for the life of a client session. I figured since the client is passing an auth header with every request anyway, it would be a good idea to associate this information with the respective auth token. Are there any design considerations I should contemplate before implementing this?

1 comment

mansilladev超过 9 年前
If your client session is long lived, it could outlive the life of the access token -- that is, if the access token is either manually revoked or automatically expires. BTW, totally not grokking the requirements/goals around association.