Polyglot has asked for the wisdom of the Perl Monks concerning the following question:

Raku seems to have a very limited selection of modules, and a search of Raku land for "session" yields only 8 results, as of today. Of those, three are for an application called "Cro" which appears to be an interface to databases, two are for "Crust" which appears to be a specific framework also involving databases, one is for AWS (Amazon?), one is for "Proc::Screen"--said to be an interface to a GNU screen session, etc. I have no idea which keyword to look for to find simple CGI-style session support. "Http" finds modules for the creation of an http server, and "cgi" finds nothing at all.

If there are no modules for this, what might be the best approach to create a simple login session in Raku using a session ID and cookies?

Blessings,

~Polyglot~

  • Comment on [RAKU] How to create a secure HTTP session in Raku?

Replies are listed 'Best First'.
Re: [RAKU] How to create a secure HTTP session in Raku?
by Corion (Patriarch) on Dec 27, 2023 at 07:24 UTC

    Cro is a general Raku framework for parallel processing, and it has an HTTP client and server with Cro::HTTP. As it is written by Jonathan Worthington, it would be my first port of call. Searching further for HTTP, that site also shows HTTP::Client, which maybe is more focused on an HTTP client.

    As you want to write a small CGI, searching for HTTP also returns HTTP::Easy, which claims to be PSGI-compatible. This is likely the closest thing you'll get for writing CGI-like scripts.

    Personally, I would look into Cro, as it seems to have both, HTTP support and session support.