Not familiar with Hapi but from docs I understand state corresponds to http cookies. If my understanding is correct, then in expressjs you can use cookie-parser middleware to get the cookies sent by client using req.cookies
var express = require('express')
var cookieParser = require('cookie-parser')
var app = express()
app.use(cookieParser())
app.get('/', function(req, res) {
console.log("Cookies: ", req.cookies)
})
app.listen(8080)
If you want to set state or in other words cookie then just set it on the response i.e. res like this. Reference
var cookieConfig = {}; // set config options here like domain, httpOnly, maxAge etc.
res.cookie('key', 'value', cookieConfig);
Not familiar with Hapi but from docs I understand
state
corresponds to http cookies. If my understanding is correct, then in expressjs you can use cookie-parser middleware to get the cookies sent by client usingreq.cookies
If you want to set state or in other words cookie then just set it on the response i.e.
res
like this. Reference