[Catalyst] setting/getting session data from within tests

A. Pagaltzis pagaltzis at gmx.de
Mon Jun 5 23:10:50 CEST 2006


* Daniel McBrearty <danielmcbrearty at gmail.com> [2006-06-05 21:10]:
> what's the advantage of using the uri?

F.ex., the page content can be cached; if it changes based on
state in a cookie, that’s not possible. The server never needs to
consult the DB to find which version of a page the user wants:
it’s right there in the URI the user requested.

> and what happens when the user closes the browser and comes
> back an hour later? why should they select again?

You do let them save a preference on the server. But the only
case that this needs to be consulted is for requests to the `/`
homepage. All other pages on the server live in namespaces where
the URI states the language and regular URI dispatch returns the
proper thing.

Since `/` itself is always only a redirect, it’s also likely that
users will bookmark something like `example.net/en/` or
`example.net/br/`, so their “configuration” is right there in
their bookmark. Obviously they don’t need to choose again.

The less state is stored implicitly in the server, and the more
of it is made explicit in the URI, the easier the entire thing is
to test, cache, distribute, etc.

Regards,
-- 
Aristotle Pagaltzis // <http://plasmasturm.org/>



More information about the Catalyst mailing list