You are viewing a plain text version of this content. The canonical link for it is here.
Posted to asp@perl.apache.org by Philip Mak <pm...@aaanime.net> on 2004/01/19 03:10:52 UTC
Session cookies not being set
I have this in global.asa:
sub Session_OnStart {
$Session->{count} = 0; # initialize page view counter
}
But my ASP scripts are not returning cookie headers to track the
session (I checked by telnetting to port 80 and doing a manual request
and looking at the headers). As a result, every single page view is
causing a new session to be created (that might explain why my system
load average is double what it used to be...).
What might cause session cookies to not be set? I don't think it's a
code or configuration problem, because it worked fine until I had to
reinstall the OS, Apache and the CPAN modules after a hard disk
corruption.
PerlSetVar NoState 0
PerlSetVar StateDir /tmp/aw_asp
/tmp/aw_asp is writable by the account running Apache.
---------------------------------------------------------------------
To unsubscribe, e-mail: asp-unsubscribe@perl.apache.org
For additional commands, e-mail: asp-help@perl.apache.org
Re: Session cookies not being set
Posted by "Fagyal, Csongor" <co...@conceptonline.hu>.
Philip Mak wrote:
>On Tue, Jan 20, 2004 at 08:02:41PM +0100, Fagyal, Csongor wrote:
>
>
>>Are you sure something (mod_accel?) is not stripping off some of
>>your headers?
>>
>>
>
>...You are right!! That is what the problem was. Thanks!
>
>localhost:8010 is direct access to the httpd backend. I guess I'll
>have to check my mod_accel configuration.
>
>
It was only a lucky guess :-) All I saw was that mod_perl was not
showing up in your headers, so something had tampered with it, and that
thing could have done other nasty things :-) Also mod_accel does things
like cookie caching 'n stuff....
[...]
>Server: Apache/1.3.29 (Unix) mod_perl/1.29
>
>
Server: Apache/1.3.29 (Unix) PHP/4.3.4 mod_deflate/1.0.19 mod_accel/1.0.31
[...]
- Csongor
---------------------------------------------------------------------
To unsubscribe, e-mail: asp-unsubscribe@perl.apache.org
For additional commands, e-mail: asp-help@perl.apache.org
Re: Session cookies not being set
Posted by Philip Mak <pm...@aaanime.net>.
On Tue, Jan 20, 2004 at 08:02:41PM +0100, Fagyal, Csongor wrote:
> Are you sure something (mod_accel?) is not stripping off some of
> your headers?
...You are right!! That is what the problem was. Thanks!
localhost:8010 is direct access to the httpd backend. I guess I'll
have to check my mod_accel configuration.
[aw@yuri httpd]$ lwp-request -ed http://localhost:8010/country.asp
Cache-Control: private
Connection: close
Date: Tue, 20 Jan 2004 19:03:47 GMT
Server: Apache/1.3.29 (Unix) mod_perl/1.29
Content-Length: 30
Content-Type: text/html
Client-Date: Tue, 20 Jan 2004 19:03:49 GMT
Client-Response-Num: 1
Set-Cookie: session-id=0d126f09b326a1d878f2c19491e499b9; path=/
[aw@yuri httpd]$ lwp-request -ed http://www.animewallpapers.com/country.asp
Cache-Control: private
Connection: close
Date: Tue, 20 Jan 2004 19:04:10 GMT
Server: Apache/1.3.29 (Unix) PHP/4.3.4 mod_deflate/1.0.19 mod_accel/1.0.31
Content-Length: 32
Content-Type: text/html
Client-Date: Tue, 20 Jan 2004 19:04:11 GMT
Client-Response-Num: 1
[aw@yuri httpd]$
---------------------------------------------------------------------
To unsubscribe, e-mail: asp-unsubscribe@perl.apache.org
For additional commands, e-mail: asp-help@perl.apache.org
Re: Session cookies not being set
Posted by "Fagyal, Csongor" <co...@conceptonline.hu>.
Philip Mak wrote:
>On Tue, Jan 20, 2004 at 10:41:04AM -0800, Josh Chamas wrote:
>
>
>>I am not sure why sessions were not working. Could you provided a header
>>request trace for such a request with sessions enabled like:
>>
>> lwp-request -ed http://someurl/somescript.asp
>>
>>There should be a session-id in there. Also make sure to delete the
>>contents of StateDir in case they were corrupted from your system crash.
>>
>>
>
>I deleted the StateDir, and Apache::ASP re-created it with all the
>hashing directories, and I can see files like:
>
>[aw@yuri aw_asp]$ ls
>00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f server
>[aw@yuri aw_asp]$ ls 00
>0000c4c1be7ca00d7c714096bc50f75c.dir 007c4f3d8a6518f2a9bfcfbaaf431d27.dir
>0000c4c1be7ca00d7c714096bc50f75c.lock 007c4f3d8a6518f2a9bfcfbaaf431d27.lock
>...
>
>The session-id is still not showing up in the headers:
>
>[pmak@lina pmak]$ lwp-request -ed http://www.animewallpapers.com/country.asp
>Cache-Control: private
>Connection: close
>Date: Tue, 20 Jan 2004 18:45:11 GMT
>Server: Apache/1.3.29 (Unix) PHP/4.3.4 mod_deflate/1.0.19 mod_accel/1.0.31
>Content-Length: 32
>Content-Type: text/html
>Client-Date: Tue, 20 Jan 2004 18:45:42 GMT
>Client-Response-Num: 1
>
>[pmak@lina pmak]$
>
>
>
Are you sure something (mod_accel?) is not stripping off some of your
headers?
- Cs.
---------------------------------------------------------------------
To unsubscribe, e-mail: asp-unsubscribe@perl.apache.org
For additional commands, e-mail: asp-help@perl.apache.org
Re: Session cookies not being set
Posted by Philip Mak <pm...@aaanime.net>.
On Tue, Jan 20, 2004 at 10:41:04AM -0800, Josh Chamas wrote:
> I am not sure why sessions were not working. Could you provided a header
> request trace for such a request with sessions enabled like:
>
> lwp-request -ed http://someurl/somescript.asp
>
> There should be a session-id in there. Also make sure to delete the
> contents of StateDir in case they were corrupted from your system crash.
I deleted the StateDir, and Apache::ASP re-created it with all the
hashing directories, and I can see files like:
[aw@yuri aw_asp]$ ls
00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f server
[aw@yuri aw_asp]$ ls 00
0000c4c1be7ca00d7c714096bc50f75c.dir 007c4f3d8a6518f2a9bfcfbaaf431d27.dir
0000c4c1be7ca00d7c714096bc50f75c.lock 007c4f3d8a6518f2a9bfcfbaaf431d27.lock
...
The session-id is still not showing up in the headers:
[pmak@lina pmak]$ lwp-request -ed http://www.animewallpapers.com/country.asp
Cache-Control: private
Connection: close
Date: Tue, 20 Jan 2004 18:45:11 GMT
Server: Apache/1.3.29 (Unix) PHP/4.3.4 mod_deflate/1.0.19 mod_accel/1.0.31
Content-Length: 32
Content-Type: text/html
Client-Date: Tue, 20 Jan 2004 18:45:42 GMT
Client-Response-Num: 1
[pmak@lina pmak]$
---------------------------------------------------------------------
To unsubscribe, e-mail: asp-unsubscribe@perl.apache.org
For additional commands, e-mail: asp-help@perl.apache.org
Re: Session cookies not being set
Posted by Josh Chamas <jo...@chamas.com>.
Philip Mak wrote:
> On Mon, Jan 19, 2004 at 11:33:37AM -0800, Josh Chamas wrote:
>
>>This is just a theory though, it seems to be that the session cookies
>>would be set no matter what. Now if you upgraded mod_perl & Apache, it
>>may be that the PerSetVar configs are being merged differently, so that
>>your settings are not what you think. The best way to confirm this is
>>to set Debug -1, and check the output in the error_log to see what
>>configs Apache::ASP thinks there are running. If you could post such
>>error_log output to the list for one request that would be helpful.
>
>
> Here it is:
>
> http://lina.aaanime.net/~pmak/tmp/err.txt
>
> I took an excerpt of my error_log and grepped for [9044] so that it
> only shows what one process is doing.
>
Sessions were enabled correctly per the error_log trace you provided.
I am not sure why sessions were not working. Could you provided a header
request trace for such a request with sessions enabled like:
lwp-request -ed http://someurl/somescript.asp
There should be a session-id in there. Also make sure to delete the
contents of StateDir in case they were corrupted from your system crash.
Also I noticed that you had both Application & Session objects active.
If you do not need the Application object, make sure to turn it off
with
PerlSetVar AllowApplicationState Off
since just creating the Application object can be a significant penalty
if you do not need it.
Regards,
Josh
________________________________________________________________
Josh Chamas, Founder phone:925-552-0128
Chamas Enterprises Inc. http://www.chamas.com
NodeWorks Link Checker http://www.nodeworks.com
---------------------------------------------------------------------
To unsubscribe, e-mail: asp-unsubscribe@perl.apache.org
For additional commands, e-mail: asp-help@perl.apache.org
Re: Session cookies not being set
Posted by Philip Mak <pm...@aaanime.net>.
On Mon, Jan 19, 2004 at 11:33:37AM -0800, Josh Chamas wrote:
> This is just a theory though, it seems to be that the session cookies
> would be set no matter what. Now if you upgraded mod_perl & Apache, it
> may be that the PerSetVar configs are being merged differently, so that
> your settings are not what you think. The best way to confirm this is
> to set Debug -1, and check the output in the error_log to see what
> configs Apache::ASP thinks there are running. If you could post such
> error_log output to the list for one request that would be helpful.
Here it is:
http://lina.aaanime.net/~pmak/tmp/err.txt
I took an excerpt of my error_log and grepped for [9044] so that it
only shows what one process is doing.
---------------------------------------------------------------------
To unsubscribe, e-mail: asp-unsubscribe@perl.apache.org
For additional commands, e-mail: asp-help@perl.apache.org
Re: Session cookies not being set
Posted by Josh Chamas <jo...@chamas.com>.
Philip Mak wrote:
> I have this in global.asa:
>
> sub Session_OnStart {
> $Session->{count} = 0; # initialize page view counter
> }
>
> But my ASP scripts are not returning cookie headers to track the
> session (I checked by telnetting to port 80 and doing a manual request
> and looking at the headers). As a result, every single page view is
> causing a new session to be created (that might explain why my system
> load average is double what it used to be...).
>
> What might cause session cookies to not be set? I don't think it's a
> code or configuration problem, because it worked fine until I had to
> reinstall the OS, Apache and the CPAN modules after a hard disk
> corruption.
>
> PerlSetVar NoState 0
> PerlSetVar StateDir /tmp/aw_asp
>
> /tmp/aw_asp is writable by the account running Apache.
>
There could be a change that your StateDir is corrupted from the hard
drive corruption you experienced, in which case the easiest fix is
shutdown the web server temporarily and delete the contents of StateDir.
This is just a theory though, it seems to be that the session cookies
would be set no matter what. Now if you upgraded mod_perl & Apache, it
may be that the PerSetVar configs are being merged differently, so that
your settings are not what you think. The best way to confirm this is
to set Debug -1, and check the output in the error_log to see what
configs Apache::ASP thinks there are running. If you could post such
error_log output to the list for one request that would be helpful.
Regards,
Josh
________________________________________________________________
Josh Chamas, Founder phone:925-552-0128
Chamas Enterprises Inc. http://www.chamas.com
NodeWorks Link Checker http://www.nodeworks.com
---------------------------------------------------------------------
To unsubscribe, e-mail: asp-unsubscribe@perl.apache.org
For additional commands, e-mail: asp-help@perl.apache.org