You are viewing a plain text version of this content. The canonical link for it is here.
Posted to embperl@perl.apache.org by Derrick Spell <de...@cdmplus.com> on 2005/10/17 20:47:39 UTC

Cookies not set

I'm having an issue where sometimes the cookie is not being set on  
the client.  If you do a graceful restart of apache and then try  
again, the cookie is set.  What's even more strange is that not all  
clients are having this problem, but the ones that do will have the  
problem consistently until I restart the webserver (meaning it  
doesn't seem to matter which apache child they get, they do not get  
the cookie).  Frankly, I'm baffled.  Does anyone have any idea what  
may be happening.  My embperl config is below

Embperl_Cookie_Name "MySecureCookie"
Embperl_Cookie_Path /secure
Embperl_Cookie_Expires "+12h"
Embperl_Cookie_Secure 1



-Derrick

"Perl's grammar can not be reduced to BNF.
The work of parsing perl is distributed between
yacc, the lexer, smoke and mirrors.''
-Chaim Frenkel



---------------------------------------------------------------------
To unsubscribe, e-mail: embperl-unsubscribe@perl.apache.org
For additional commands, e-mail: embperl-help@perl.apache.org


RE: Cookies not set

Posted by Gerald Richter <ri...@ecos.de>.
> 
> I just tried to apply the patch and had two issues:
> 
> * I don't have a podsrc/Config.spod, so it couldn't apply the 
> patch.   
> I'm guessing this is no big deal.  I'm using the 
> Embperl-2.1.0 installation tree.
> 

Yes, this is only in the svn source and used to build Config.pod

> * After applying the patch and running perl Makefile.PL;  
> make;  make test;  I got the following error:
> 
> [-1][30304]ERR:  24:  Error in Perl code: Can't locate object 
> method "cookie_expires" via package "Embperl::Req" at 
> /home/admin/ Embperl-2.1.0/test/html/cookieexpire.htm line 6.
> 

You could fix this by running xsbuiler/source_scan.pl and
xsbuilder/xs_generate.pl

To simplify things I send you an updated version per private email

Gerald



 
** Virus checked by BB-5000 Mailfilter ** 


---------------------------------------------------------------------
To unsubscribe, e-mail: embperl-unsubscribe@perl.apache.org
For additional commands, e-mail: embperl-help@perl.apache.org


Re: Cookies not set

Posted by Derrick Spell <de...@cdmplus.com>.
I just tried to apply the patch and had two issues:

* I don't have a podsrc/Config.spod, so it couldn't apply the patch.   
I'm guessing this is no big deal.  I'm using the Embperl-2.1.0  
installation tree.

* After applying the patch and running perl Makefile.PL;  make;  make  
test;  I got the following error:

[-1][30304]ERR:  24:  Error in Perl code: Can't locate object method  
"cookie_expires" via package "Embperl::Req" at /home/admin/ 
Embperl-2.1.0/test/html/cookieexpire.htm line 6.

Let me know if I messed up.  I'm still new to patches.

-Derrick


On Dec 9, 2005, at 4:00 PM, Gerald Richter wrote:

> Hi,
>
>> Enabling dbgSession has illuminated the problem.  The date
>> calculation seems to be made at the time the server starts
>> up, not at the time the cookie is sent.  I used grep to look
>> at all the cookies that have been sent in the last week, and
>> they all have the exact same cookie expiration date (which of
>> course, was 12 hours after I restarted the server last week).
>>
>
> Yes, you are right! The attached patch fixes the problem
>
> Gerald
>
>
>
> ** Virus checked by BB-5000 Mailfilter **
> <expires.patch>


---------------------------------------------------------------------
To unsubscribe, e-mail: embperl-unsubscribe@perl.apache.org
For additional commands, e-mail: embperl-help@perl.apache.org


RE: Cookies not set

Posted by Gerald Richter <ri...@ecos.de>.
Hi,

> Enabling dbgSession has illuminated the problem.  The date 
> calculation seems to be made at the time the server starts 
> up, not at the time the cookie is sent.  I used grep to look 
> at all the cookies that have been sent in the last week, and 
> they all have the exact same cookie expiration date (which of 
> course, was 12 hours after I restarted the server last week).
> 

Yes, you are right! The attached patch fixes the problem

Gerald


 
** Virus checked by BB-5000 Mailfilter ** 

Re: Cookies not set

Posted by Derrick Spell <de...@cdmplus.com>.
On Oct 28, 2005, at 3:36 PM, Gerald Richter wrote:

>>
>> I finally had the time to get in and look at the headers.  It
>> seems the issue was in the expiration calculation.  The
>> cookie that was coming through was set to expire 10 mins
>> before it got there!  I changed the cookie_expires in my
>> config file to read "+1d" but still no good.  Even though it
>> said +1d, I was getting cookies that either would expire
>> within 10 mins or had already expired.
>
> Could you please do the following test:
>
> Edit test/conf/httpd.conf.src, goto line 153 and add the line
>
>   Embperl_Cookie_Expires +1d
>
> Now run
>
>   make test TESTARGS="-h 161 162 163 164"
>
> Then look at test/tmp/test.log and search for SES:. The second time  
> you find
> it, you should see the cookie that is sent. Does it have the  
> correct time
> i.e. one day ahead? (this works for me)
>
> If it works you see enable dbgSession and watch your embperl.log,  
> what time
> shows up there.
>

Enabling dbgSession has illuminated the problem.  The date  
calculation seems to be made at the time the server starts up, not at  
the time the cookie is sent.  I used grep to look at all the cookies  
that have been sent in the last week, and they all have the exact  
same cookie expiration date (which of course, was 12 hours after I  
restarted the server last week).

-Derrick


---------------------------------------------------------------------
To unsubscribe, e-mail: embperl-unsubscribe@perl.apache.org
For additional commands, e-mail: embperl-help@perl.apache.org


RE: Cookies not set

Posted by Gerald Richter <ri...@ecos.de>.
> 
> I finally had the time to get in and look at the headers.  It 
> seems the issue was in the expiration calculation.  The 
> cookie that was coming through was set to expire 10 mins 
> before it got there!  I changed the cookie_expires in my 
> config file to read "+1d" but still no good.  Even though it 
> said +1d, I was getting cookies that either would expire 
> within 10 mins or had already expired.
> 
> Now, I have had problems with my system clock losing time.  
> At one point it was more than 30 mins behind.  I have since 
> attempted to set up an ntp daemon, although I'm not convinced 
> of my success.  Right now my clock is a little less than 3 
> mins behind the real time.
> 
> However, 3 mins does not explain why the day won't increment. 
>  Is there anything else I can check that may be causing this? 
>  In the meantime I've put in an explicit expiration of Jan 1, 
> 2006.  In case it matters, my system clock is set to the 
> local time (US Eastern Daylight Time, or GMT -05:00).
> 

Could you please do the following test:

Edit test/conf/httpd.conf.src, goto line 153 and add the line

  Embperl_Cookie_Expires +1d

Now run

  make test TESTARGS="-h 161 162 163 164"

Then look at test/tmp/test.log and search for SES:. The second time you find
it, you should see the cookie that is sent. Does it have the correct time
i.e. one day ahead? (this works for me)

If it works you see enable dbgSession and watch your embperl.log, what time
shows up there.

Gerald




 
** Virus checked by BB-5000 Mailfilter ** 


---------------------------------------------------------------------
To unsubscribe, e-mail: embperl-unsubscribe@perl.apache.org
For additional commands, e-mail: embperl-help@perl.apache.org


Re: Cookies not set

Posted by Derrick Spell <de...@cdmplus.com>.
>> I'm having an issue where sometimes the cookie is not being
>> set on the client.  If you do a graceful restart of apache
>> and then try again, the cookie is set.  What's even more
>> strange is that not all clients are having this problem, but
>> the ones that do will have the problem consistently until I
>> restart the webserver (meaning it doesn't seem to matter
>> which apache child they get, they do not get the cookie).
>> Frankly, I'm baffled.  Does anyone have any idea what may be
>> happening.  My embperl config is below
>>
>> Embperl_Cookie_Name "MySecureCookie"
>> Embperl_Cookie_Path /secure
>> Embperl_Cookie_Expires "+12h"
>> Embperl_Cookie_Secure 1
>
> Do you have any chance to sniff the network traffic (e.g. with  
> ethereal) and
> see if the cookies are really not sent at all?
>
> You may also compare the request/response to the a request which works
>
> Gerald

I finally had the time to get in and look at the headers.  It seems  
the issue was in the expiration calculation.  The cookie that was  
coming through was set to expire 10 mins before it got there!  I  
changed the cookie_expires in my config file to read "+1d" but still  
no good.  Even though it said +1d, I was getting cookies that either  
would expire within 10 mins or had already expired.

Now, I have had problems with my system clock losing time.  At one  
point it was more than 30 mins behind.  I have since attempted to set  
up an ntp daemon, although I'm not convinced of my success.  Right  
now my clock is a little less than 3 mins behind the real time.

However, 3 mins does not explain why the day won't increment.  Is  
there anything else I can check that may be causing this?  In the  
meantime I've put in an explicit expiration of Jan 1, 2006.  In case  
it matters, my system clock is set to the local time (US Eastern  
Daylight Time, or GMT -05:00).

-Derrick


---------------------------------------------------------------------
To unsubscribe, e-mail: embperl-unsubscribe@perl.apache.org
For additional commands, e-mail: embperl-help@perl.apache.org


RE: Cookies not set

Posted by Martin Moss <ma...@btopenworld.com>.
Forgive the daft question, but are the cookies only
failing to be set on Internet Explorer 6 ?

It could be that some of the users have Medium high or
High Privacy settings, and you're not sending a P3P
header.. so Internet explorer just ignores the set
cookie Headers...

Just a thought..

Regards

Marty
--- Gerald Richter <ri...@ecos.de> wrote:

> Hi,
> 
> 
> > I'm having an issue where sometimes the cookie is
> not being 
> > set on the client.  If you do a graceful restart
> of apache 
> > and then try again, the cookie is set.  What's
> even more 
> > strange is that not all clients are having this
> problem, but 
> > the ones that do will have the problem
> consistently until I 
> > restart the webserver (meaning it doesn't seem to
> matter 
> > which apache child they get, they do not get the
> cookie).  
> > Frankly, I'm baffled.  Does anyone have any idea
> what may be 
> > happening.  My embperl config is below
> > 
> > Embperl_Cookie_Name "MySecureCookie"
> > Embperl_Cookie_Path /secure
> > Embperl_Cookie_Expires "+12h"
> > Embperl_Cookie_Secure 1
> > 
> 
> Do you have any chance to sniff the network traffic
> (e.g. with ethereal) and
> see if the cookies are really not sent at all?
> 
> You may also compare the request/response to the a
> request which works
> 
> Gerald
> 
> 
>  
> ** Virus checked by BB-5000 Mailfilter ** 
> 
> 
>
---------------------------------------------------------------------
> To unsubscribe, e-mail:
> embperl-unsubscribe@perl.apache.org
> For additional commands, e-mail:
> embperl-help@perl.apache.org
> 
> 



		
___________________________________________________________ 
To help you stay safe and secure online, we've developed the all new Yahoo! Security Centre. http://uk.security.yahoo.com

---------------------------------------------------------------------
To unsubscribe, e-mail: embperl-unsubscribe@perl.apache.org
For additional commands, e-mail: embperl-help@perl.apache.org


RE: Cookies not set

Posted by Gerald Richter <ri...@ecos.de>.
Hi,


> I'm having an issue where sometimes the cookie is not being 
> set on the client.  If you do a graceful restart of apache 
> and then try again, the cookie is set.  What's even more 
> strange is that not all clients are having this problem, but 
> the ones that do will have the problem consistently until I 
> restart the webserver (meaning it doesn't seem to matter 
> which apache child they get, they do not get the cookie).  
> Frankly, I'm baffled.  Does anyone have any idea what may be 
> happening.  My embperl config is below
> 
> Embperl_Cookie_Name "MySecureCookie"
> Embperl_Cookie_Path /secure
> Embperl_Cookie_Expires "+12h"
> Embperl_Cookie_Secure 1
> 

Do you have any chance to sniff the network traffic (e.g. with ethereal) and
see if the cookies are really not sent at all?

You may also compare the request/response to the a request which works

Gerald


 
** Virus checked by BB-5000 Mailfilter ** 


---------------------------------------------------------------------
To unsubscribe, e-mail: embperl-unsubscribe@perl.apache.org
For additional commands, e-mail: embperl-help@perl.apache.org