FAQ
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. 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.

What would be the best approach on this problem. Write a Catalyst::Plugin:Session::State based module? If so, some pointers on doing so would be nice. I'm not very familiar with Catalyst and Moose, so I'm struggling a bit on this part.

Thanks,

Christiaan

Search Discussions

  • Christiaan Kras at Feb 14, 2010 at 12:33 pm
    It seems it's already possible with the Catalyst::Plugin::Session::State Cookie andd URI modules.

    The howto on the Catalyst WiKi helped me out.

    So problem solved.

    -origineel bericht-
    Onderwerp: [Catalyst] Use SessionId from HTTP header
    Van: "Christiaan Kras" <[email protected]>
    Datum: 14-02-2010 12:47

    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. 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.

    What would be the best approach on this problem. Write a Catalyst::Plugin:Session::State based module? If so, some pointers on doing so would be nice. I'm not very familiar with Catalyst and Moose, so I'm struggling a bit on this part.

    Thanks,

    Christiaan


    _______________________________________________
    List: [email protected]
    Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
    Searchable archive: http://www.mail-archive.com/[email protected]/
    Dev site: http://dev.catalyst.perl.org/
  • Tomas Doran at Feb 14, 2010 at 3:52 pm

    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
  • Christiaan Kras at Feb 14, 2010 at 4:08 pm
    Tomas Doran schreef:
    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/
    Thanks for the link and preventing me from some big mistakes in the
    beginning of my application. Not using sessions makes a lot more sense
    indeed.
    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..
    Will do! This will actually make things easier.
    Cheers
    t0m


    _______________________________________________
    List: [email protected]
    Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
    Searchable archive:
    http://www.mail-archive.com/[email protected]/
    Dev site: http://dev.catalyst.perl.org/
    -------------- next part --------------
    A non-text attachment was scrubbed...
    Name: smime.p7s
    Type: application/x-pkcs7-signature
    Size: 5245 bytes
    Desc: S/MIME Cryptographic Signature
    Url : http://lists.scsys.co.uk/pipermail/catalyst/attachments/20100214/e2e97275/smime.bin

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupcatalyst @
categoriescatalyst, perl
postedFeb 14, '10 at 11:43a
activeFeb 14, '10 at 4:08p
posts4
users2
websitecatalystframework.org
irc#catalyst

2 users in discussion

Christiaan Kras: 3 posts Tomas Doran: 1 post

People

Translate

site design / logo © 2023 Grokbase