On Sep 22, 2010, at 5:47 AM, writeson wrote:

> I'm building intranet apps at work using Pylons and I have a question
> about the session. The users of my app are used to having multiple
> tabs/browsers open to the same application (which were previously CGI
> applications), and would like to do the same thing with my Pylons
> applications. Within those tabs/browsers they want to look at/interact
> with different data from the system. My question is about the session
> id; each tab/browser instance gets the same session id value. Is there
> a way to maintain unique session data for each tab/browser instance so
> the users of my application don't have data/interaction collisions
> between tab/browser instances?

The browser sends the same cookies regardless of tab, as the cookie spec 
indicates they should be sent based on the domain name + path. While you could 
do something in Javascript to set a cookie, it would of course, be sent to that 
domain by the next request regardless of tab since the browser makes no such 
distinction afaik.

The session should really only contain enough data to keep the person logged 
in, cookie's don't really work for per-tab data. What you might want to do 
instead, is if you have some sort of a process each tab is going through, have 
it on a different section of the site, such that a unique identifier in the 
session, when coupled with a specific URL, resumes a process. That way it 
wouldn't matter how many tabs/windows you have open, if they're all in 
different sections, the URL will keep them separate. You can of course also set 
the cookie's path, and if each tab was in a different URL-space, the cookie 
would be appropriate for that path.

Cheers,
Ben

-- 
You received this message because you are subscribed to the Google Groups 
"pylons-discuss" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/pylons-discuss?hl=en.

Reply via email to