I took a look at the code you have for the CGISession implementation, it looks fairly straight forward.
A couple of questions though:
- Does using Dancer::ModuleLoader->load('CGI::Session') mean that we should have access to all objects and methods exported by CGI::Session? For example, can I access CGI->self_url() somehow?
- Would I be able to access Dancer settings and variables form a sub-module? E.g.: Is there any way to access Dancer's 'cookies' or 'session' info from a module, without having to pass them as arguments to my module?
-Bobby
On Wed, May 18, 2011 at 1:25 PM, David Precious
<davidp@preshweb.co.uk> wrote:
On Wednesday 18 May 2011 16:56:39 David Precious wrote:
> In that case, the proper answer is most likely to write a
> Dancer::Session::CGISession session engine which provides compatibility
> with CGI::Session-based sessions, then set that as your chosen session
> engine and use Dancer's own session support.
>
> Writing a session engine wrapper is quite simple - you simply inherit from
> Dancer::Session::Abstract and implement the required methods. You could
> take a look at Dancer::Session::Simple for a dead-simple example.
In fact, take a look at https://github.com/bigpresh/Dancer-Session-CGISession
which I've just started.
Not yet ready to use, and I'm off out to play darts tonight so won't have it
working tonight, but should be able to finish it soon, it's pretty simple
stuff.
Feel free to fork and submit pull requests if you want to help it along :)