incubator-couchdb-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jeff Charette <ioma...@yahoo.com>
Subject Re: tracking a guest session
Date Thu, 28 Feb 2013 01:16:39 GMT
The best answer I have found is to implement my own cookie handler.  Would be awesome if couch
handled a session id for guests!

This was a ton of help
http://kan.so/packages/details/cookies

require the cookie package

Then in a show

	/* set cookie for first request */
	if (typeof req.cookie.wc_guest === 'undefined') {
		cookies.setResponseCookie(req, res, opt);
	}
	else {
		if (!res.headers) {
	        res.headers = {};
	    }
		res.headers['Set-Cookie'] = req.cookie.wc_guest;
	}

That gets me started!

Jeff Charette | Principal 
We Are Charette
web / identity / packaging

m  415.298.2707
w  wearecharette.com
e   jeffrey@wearecharette.com

On Feb 27, 2013, at 6:00 PM, Jeff Charette <iomatix@yahoo.com> wrote:

> So this seems like it should be pretty easy, but alas a google around the webosphere
later I have no answer.
> 
> What id do most people use to track a user session for a user who is not logged in. 
My use case is adding some documents to a database with the session id, then updating the
owner once the user logs in.  Think shopping cart.
> 
> AuthSession is blank of course when not logged in.
> 
> Hope I am not asking this wrong :)
> 
> Jeff Charette | Principal 
> We Are Charette
> web / identity / packaging
> 
> m  415.298.2707
> w  wearecharette.com
> e   jeffrey@wearecharette.com


Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message