[Catalyst] Browser window/tab independent sessions

Perrin Harkins perrin at elem.com
Tue Jan 9 13:48:43 GMT 2007


Carl Franks wrote:
> Can you describe how to replicate this behaviour?

You just did.  You had two windows open, and both of them worked.

> When I clicked the "View & edit your browsing history" link in each
> window, they both displayed all the books I had viewed in /both/
> windows - which as far as I understand, isn't the desired behaviour.

Right, that is global state.  An example of window-specific state is the 
search terms entered.  Open two windows, do a different search in each 
one, and page through the results.  The search term you entered is 
displayed at the top of each page.  If you click next in one window, it 
doesn't get confused and display the term from the other window, or the 
results for the other term.  If they stored the search term in a 
cookie-based session, it would.

I once saw some highly paid Java contractors build a web search which 
cached the full results of each search in the person's session.  Not 
only is this a terrible abuse of sessions, it caused absolute mayhem 
when people opened two windows.  Clicking next in one would start 
showing you results from the other.  It was terrible.

- Perrin



More information about the Catalyst mailing list