I have a web app that makes use of node.js in the backend and angulajs on the front end. Let's say I have a user who has the ability to login via multiple systems; I must allow multiple logins. I am making use of jsonwebtoken module to generate token for a user after he is authenticated and that is saved in the redis and the token is sent back to the user which is saved in his cookie. Let's say I have expiration time of 5 hours on both the cookie and the token (redis). How can I plan the whole thing out? Even if I use a set to save multiple tokens in redis then I cannot actually add expiration time on each value. And on top of all that I must accommodate refresh tokens so that if a user is using system regularly then his token stays active. 
Web App Authentication's Architecture Related Query
architecture;node.js;authentication;angularjs;redis