[Chicago-talk] Apache::Session - Cookie Question

Scott T. Hildreth shild at sbcglobal.net
Tue Feb 24 22:03:33 CST 2004

Figured it out, after re-reading CGI::Cookie perldoc, I added -domain in
the cookie creation component of RT.  I tried this in my local server at
home, but the $r->header_out() would not create the cookie when I added 
-domain.  I logged into work and tried on the production server and it
worked.  The cookies all have the same domain name, so all the cookies
are passed by the browser.  When I am on my server at home, the host
defaults to localhost, so I thought the browser would pass all the
cookies that had the 'host =>'.  I tried setting the domain to
my servers hostname which would work with the cgi_test prog, but like I 
said earlier the mod_perl's $r-header_out would not set the cookie
whenever I set the -domain.  Forgive my rambling, I spent hours on this
and turns out my test environment was hindering my success.  I'm just
happy the damn thing works now. =)  


On Tue, 2004-02-24 at 18:43, Scott T. Hildreth wrote:
> I think I got...sort of, the cookies.txt is the serialized cookies as
> the Apache::Session::MySQL is for the RT cookie.  The mozilla is caching
> the cookies in memory, that is how the cookie manager is accessing all
> the cookies.  So CGI::Cookies->fetch() is still getting the cookies from
> the request header. Right?
> On Tue, 2004-02-24 at 16:40, Scott T. Hildreth wrote:
> > We are using Request Tracker at work, which is using Mysql as the
> > backend db. So RT is using Apache::Session::Mysql to store the cookie
> > and other seesion data.  We have a intranet that has a login screen that
> > sets a cookie, allowing access to all the web pages without additional
> > logins.  They would like to have RT use that cookie as a login status as
> > well.  Not being much of a web developer, I've had to learn a lot about
> > mod_perl, Html::Mason, apache, and cookies in a short time period.  Has 
> > been fun, I've been wanting to work with this environment for a while. 
> > I have had the Mason Book and Apache Module books for some time, now I
> > get to actually use them.  Okay back to my question :-), when I use the
> > mozilla cookie manager, I can see all the cookies including the RT one.
> > In my ~/.mozilla dir I can see all the cookies except the RT one in the
> > cookies.txt file.  The RT cookie is serialized in the Mysql db.  When
> > the RT::mason handler is called via a browser, there is a Setupsession
> > Component that makes a CGI::Cookie->fetch() call.  This only returns the
> > cookie that is serialized in the db and not the cookies that are in the
> > cookies.txt file, even though the domain is the same(which is localhost
> > for my testing).  I think I understand that the request is handed off to
> > a mod_per/Mason handler which is ,for a lack of better understanding,
> > its own environment/process.  How does CGI::Cookie get pointed to the
> > stored session data and not retrieve the on disk cookies as well?  Does
> > anyone have any ideas or tips on how to get the on disk cookie to be
> > returned to the session?  I hope this makes sense, I am not really sure
> > how to word it  since I am not quite sure what is going on.
> > 
> > 
> >                                         Thanks,
> >                                                STH
> > _______________________________________________
> > Chicago-talk mailing list
> > Chicago-talk at mail.pm.org
> > http://mail.pm.org/mailman/listinfo/chicago-talk
> _______________________________________________
> Chicago-talk mailing list
> Chicago-talk at mail.pm.org
> http://mail.pm.org/mailman/listinfo/chicago-talk

More information about the Chicago-talk mailing list