I'm using node/express.js with cookie-session's in my application and am trying to understand the proper way create a unique ID for each session.
Currently, when a user logs in a cookie is stored in their browser with a value, for example: session: ABC123
. If the user logs out, the cookie is deleted. When the user logs back in, the same cookie and value are stored in the browser session: ABC123
.
Ideally, I would like to randomize the session value so I can count the number of unique sessions this user has created. I'm wondering if there is a way to randomize the cookie-session value on every login -- or, should I be creating a separate cookie that stores a random value for this purpose?
Thanks!