Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

request.yar.get from catbox-mongodb #112

Closed
ghost opened this issue May 31, 2017 · 1 comment
Closed

request.yar.get from catbox-mongodb #112

ghost opened this issue May 31, 2017 · 1 comment

Comments

@ghost
Copy link

ghost commented May 31, 2017

How can i get a session from catbox-mongodb?

const server = new Hapi.Server({
	cache: [{
		name: 'mongoCache',
		engine: require('catbox-mongodb'),
		host: '127.0.0.1',
		partition: 'cache'
	}]
});

server.register([{
	register: Yar,
	options: {
		storeBlank: false,
		maxCookieSize: 0,
		errorOnCacheNotReady: true,
		cache: {
			cache: 'mongoCache',
			expiresIn: 48 * 60 * 60 * 1000,
			segment: 'session'
		},
		cookieOptions: {
			password: 'secret',
			isSecure: false,
			clearInvalid: true,
			isSameSite: 'Strict',
			isHttpOnly: true,
			ttl: 0
		}
	}
}]);

setting the session with req.yar.set('test', {}) and can't get the data with req.yar.get('test');

@ghost
Copy link
Author

ghost commented May 31, 2017

nvm.. ttl shouldn't be 0 and getting the data with req.yar._store.test is working fine!

@ghost ghost closed this as completed May 31, 2017
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

0 participants