[Catalyst] Use SessionId from HTTP header

Tomas Doran bobtfish at bobtfish.net
Sun Feb 14 15:55:23 GMT 2010


On 14 Feb 2010, at 11:43, Christiaan Kras wrote:

> In a RESTful application I'm working I'd like to be able to load a  
> session based on the sessionid which is sent with the HTTP headers.

It's perfectly arguable that you just failed at REST.

http://www.prescod.net/rest/mistakes/

> The application will, at a later stadium, get a webinterface as well  
> so I'd still like to use cookies, except for the RESTful part I want  
> to be able to choose.

Do HTTP auth (Catalyst::Authentication::Credential::HTTP) in the  
RESTful part, and use standard password & cookies for the non-restful  
part.

You just configure 2 different realms in your authentication config,  
and call $c->authenticate with a realm parameter..

Cheers
t0m




More information about the Catalyst mailing list