l i n u x - u s e r s - g r o u p - o f - d a v i s
L U G O D
 
Next Meeting:
April 21: Google Glass
Next Installfest:
TBD
Latest News:
Mar. 18: Google Glass at LUGOD's April meeting
Page last updated:
2003 May 22 18:18

The following is an archive of a post made to our 'vox-tech mailing list' by one of its subscribers.

Report this post as spam:

(Enter your email address)
Re: [vox-tech] Trying to use Apache::Cookie
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [vox-tech] Trying to use Apache::Cookie



Have you tried $r->send_http_header() as it looks like bake only adds the 
cookie to the request header but you're not sending anything.

Maybe before dealing with cookies you should pile through man Apache and 
fiddle with all the functions there.  That is if you got time and your 
playing with it all.  

On Thursday 22 May 2003 04:00 pm, Jay Strauss wrote:
> I thought you guys all said you've used mod_perl.  Did everyone ignore this
> post?
>
> Jay
> ----- Original Message -----
> From: "Jay Strauss" <me@heyjay.com>
> To: "vox-tech" <vox-tech@lists.lugod.org>
> Sent: Wednesday, May 21, 2003 11:18 PM
> Subject: [vox-tech] Trying to use Apache::Cookie
>
> > Ok, since it seems mod_perl is an appropriate topic.  Here a mod_perl
> > question.
> >
> > I'm trying to use Apache::Cookie.  But I'm unable to send the cookie.  I
>
> can
>
> > pick it up fine using Apache::Cookie->fetch (if I send it using
> > CGI::Cookie). I must not be doing something, like sending the header, or
>
> I'm
>
> > doing something else wrong.  Below are 2 pieces of code the first is
> > supposed to create a cookie, the second fetches it and displays the keys.
> >
> > Thanks
> > Jay
> >
> > package Apache::Init;
> >
> > use strict;
> > use Apache::Constants qw(:common);
> > use Apache::Cookie;
> > use CGI::Cookie;
> > use CGI qw/:standard/;
> >
> > sub handler {
> >    my $r = shift;
> >
> > #  If I do it like this it works
> > #
> >  #my $cookie1 = new CGI::Cookie(-name=>'ID',-value=>123456);
> > #my $cookie2 = new CGI::Cookie(-name=>'preferences',
> > #                            -value=>{ font => 'Helvetica',
> > #                                      size => 12 }
> > #                            );
> > #print header(-cookie=>[$cookie1,$cookie2]);
> >
> >    my $cookie = Apache::Cookie->new($r,
> >                              -name    =>  'foo',
> >                              -value   =>  'bar',
> >                              -expires =>  '+3M',
> >                              -domain  =>  '.heyjay.com',
> >                              -secure  =>  1
> >                             );
> >
> >    $cookie->bake;
> >
> >    return OK;
> >
> > }
> >
> >
> > 1;
> >
> >
> > Second Code
> > ===========
> > package Apache::Catch;
> >
> > use strict;
> > use Apache::Constants qw(:common);
> > use CGI '-autoload';
> > use Apache::Cookie;
> > use CGI::Cookie;
> >
> > sub handler {
> >    my $r = shift;
> >    my %cookies = Apache::Cookie->fetch;
> >
> >    map{$r->log_error($_); print "$_\n"} keys %cookies;
> >    return OK;
> >
> > }
> >
> > 1;
> >
> > __END__
> >
> >
> >
> > _______________________________________________
> > vox-tech mailing list
> > vox-tech@lists.lugod.org
> > http://lists.lugod.org/mailman/listinfo/vox-tech
>
> _______________________________________________
> vox-tech mailing list
> vox-tech@lists.lugod.org
> http://lists.lugod.org/mailman/listinfo/vox-tech

_______________________________________________
vox-tech mailing list
vox-tech@lists.lugod.org
http://lists.lugod.org/mailman/listinfo/vox-tech



LinkedIn
LUGOD Group on LinkedIn
Sign up for LUGOD event announcements
Your email address:
facebook
LUGOD Group on Facebook
'Like' LUGOD on Facebook:

Hosting provided by:
Sunset Systems
Sunset Systems offers preconfigured Linux systems, remote system administration and custom software development.

LUGOD: Linux Users' Group of Davis
PO Box 2082, Davis, CA 95617
Contact Us

LUGOD is a 501(c)7 non-profit organization
based in Davis, California
and serving the Sacramento area.
"Linux" is a trademark of Linus Torvalds.

Sponsored in part by:
O'Reilly and Associates
For numerous book donations.