Your questions:
- How can I update/change a cookie through RedisStore?
- It looks like session data is saved only in cookies. How can I keep track of user information from page to page if someone has cookies turned off?
Cookies / Sessions / RedisStore Thoughts:
- Typically, you have exactly one cookie, which is the session id
- All user-state is stored on the server in a "session" which can be found via the session id
- You can use Redis as your back-end storage for your session data.
- Redis will allow you to keep session state, even when your server is restarted (good thing)
- You can store a mountain of data in your session (req.session.key = value)
- All data stored in the session will be persistant until the user logs out, or their session expires
Example node.js Code:
var app = express.createServer(
express.static(__dirname + '/public', { maxAge: 31557600000 }),
express.cookieParser(),
express.session({ secret: 'secret', store: new RedisStore({
host: 'myredishost',
port: 'port',
pass: 'myredispass',
db: 'dbname',
}, cookie: { maxAge: 600000 })})
);
Session and Cookie Thoughts:
- Your second issue us about sessions without cookies. This is possible.
- You, basically, put the session id on the url of every request you send to the server.
- I strongly believe that most people allow cookies.
- If this is a requirement, google: "session without cookies"