On 12/16/05, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
> Seems like I have spent more time on C::A::P::Session than all the other
> plugins combined--and I just can't get it to work.

That is odd, as it usually works out of the box without requiring any
configuration.

> It is setting a session
> in cgiapp_postrun after logging in for the first time (it is also setting
> a cookie very nicely). This is evidenced by the line: 'logged_in: 1" in my
> debug2.txt file and the visual setting of the cookie.
>
> However, when I come return from the next HTML page to execute another
> runmode, the session is coming up empty. This is evidenced by the line:
> 'logged_in: ' in my debug1.txt file.
>
> In good olde CGI::Session, I have to use the session id to retrieve the
> session:
>
>    my $session_id = cookie('CGISESSID');
>    my $session = new CGI::Session("driver:File", $session_id,
> {Directory=>'/tmp'});

Actually, you don't have to do that with CGI::Session, you can just
give it a CGI.pm object and it will figure out the session_id from
that.  That is the technique that CAP::Session uses.

> I see that an id is created in the cookie by C::A::P::S, but how is it use
> to retrieve the session, if at all? Here's my bare bones code:
>
> sub cgiapp_init {
>    my $self = shift;
>
>    $self->session_config(
>        CGI_SESSION_OPTIONS => [ "driver:File", $self->query,
> {Directory=>'/tmp'} ],
>        DEFAULT_EXPIRY      => '+15m',
>        COOKIE_PARAMS       => { -name    => 'designsoft',
>                                 -path    => '/'},
>        SEND_COOKIE         => 1);

What you are doing here is telling CAP::Session to use a different
name for the cookie.  The docs for CAP::Session warn you about doing
that.  My recommendation would be to comment out your entire
'session_config'  line and let CAP::Session use its defaults.  That
should work for everyone.  Then you can start adding customizations in
and test as you make changes.  That way you will figure out where
things are going wrong.

Cheers,

Cees

---------------------------------------------------------------------
Web Archive:  http://www.mail-archive.com/[email protected]/
              http://marc.theaimsgroup.com/?l=cgiapp&r=1&w=2
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to