Session handling, different session ID returned with each request

1,285 views
Skip to first unread message

Fr0stbite

unread,
May 7, 2011, 5:58:32 PM5/7/11
to Express
Hi there! I am relatively new to node/express, and am in the process
of trying to implement sessions.

I copied an pasted both examples in the session examples directory
(with the exception of changing the "cookieDecoder" to "cookieParser"
on line 17 of the redis example and am getting the same result I
receive in my own code. It appears that the session is being
regenerated with every request of the page, i.e. the examples only
show 1 page view repeatedly.

I guess the main question is, did something change in session
implementation since the release of the documentation that I am
missing?

_Zach

unread,
May 19, 2011, 8:32:59 PM5/19/11
to Express
I'm also have this same issue. Were you able to solve this problem ?

On 7 Mai, 17:58, Fr0stbite <gkl...@graymttr.com> wrote:
> Hi there! I am relatively new to node/express, and am in the process
> of trying to implement sessions.
>
> I copied an pasted both examples in thesessionexamples directory
> (with the exception of changing the "cookieDecoder" to "cookieParser"
> on line 17 of the redis example and am getting the same result I
> receive in my own code. It appears that thesessionis being
> regenerated witheveryrequestof the page, i.e. the examples only

TJ Holowaychuk

unread,
May 19, 2011, 9:38:53 PM5/19/11
to expre...@googlegroups.com
weird, works for me (the express session example)

-- 
TJ Holowaychuk
--
You received this message because you are subscribed to the Google Groups "Express" group.
To post to this group, send email to expre...@googlegroups.com.
To unsubscribe from this group, send email to express-js+...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/express-js?hl=en.

Laurie Harper

unread,
May 19, 2011, 9:57:18 PM5/19/11
to expre...@googlegroups.com
Try running the examples directly without copy/pasting them (for example: cd node_modules/express/examples/session; node app.js) and, if that doesn't work either, post the resulting error(s).

L.

> --
> You received this message because you are subscribed to the Google Groups "Express" group.
> To post to this group, send email to expre...@googlegroups.com.
> To unsubscribe from this group, send email to express-js+...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/express-js?hl=en.
>

--
Laurie Harper
http://laurie.holoweb.net/

_Zach

unread,
May 20, 2011, 12:20:09 AM5/20/11
to Express
The examples do work, so that is good!

My issue had to do with several things - namely mixing up the res and
req variables within a callback. Sessions are now working for me.
Thanks for the direction on Express examples! These are not included
within the npm install so I missed them.

Many thanks!

_Zach

vision media [ Tj Holowaychuk ]

unread,
May 20, 2011, 1:02:42 AM5/20/11
to expre...@googlegroups.com
ah, yeah they are in .npmignore so it doesn't bloat the repo to much in the registry
Tj Holowaychuk
Vision Media
President & Creative Lead

Laurie Harper

unread,
May 20, 2011, 1:05:10 AM5/20/11
to expre...@googlegroups.com
Mphh... there aren't *that* many examples you know... ;-)

TJ Holowaychuk

unread,
May 20, 2011, 1:06:47 AM5/20/11
to expre...@googlegroups.com
haha :p but no point including those / tests etc in the package really. I'd like to have the new site pull in the examples from github dynamically so they can be viewed from the site with annotations or something, so people actually notice them

-- 
TJ Holowaychuk

Laurie Harper

unread,
May 20, 2011, 5:48:43 AM5/20/11
to expre...@googlegroups.com
Agreed, that'd be ideal; more people read the documentation than dig around in the installed package directory ;-) How is the site (going to be) built? It looks like what's in the gh-pages branch now is a static snapshot...

Laurie Harper

unread,
May 20, 2011, 5:50:01 AM5/20/11
to expre...@googlegroups.com
Agreed, that'd be ideal; more people read the documentation than dig around in the installed package directory ;-) How is the site (going to be) built? It looks like what's in the gh-pages branch now is a static snapshot...
On 2011-05-20, at 1:06 AM, TJ Holowaychuk wrote:

vision media [ Tj Holowaychuk ]

unread,
May 20, 2011, 7:33:02 AM5/20/11
to expre...@googlegroups.com
yeah the current one is just compiled from ./docs, but i've started the next one with express
Reply all
Reply to author
Forward
0 new messages