NYCPHP Meetup

NYPHP.org

[nycphp-talk] PHP session id's in access logs

Andrew Yochum andrew at digitalpulp.com
Wed Jul 2 13:12:22 EDT 2003


Hi Winston,

On Wed, Jul 02, 2003 at 12:00:18PM -0400, Winston Churchill-Joell wrote:
> Hi all,
> 
> I have a question about user session id's showing up in apache access 
> logs. We're trying to do some more in-depth analysis of our traffic and 
> sessions came up, of course. My understanding of how PHP manages 
> sessions is that it will propagate the ID in the URL if the browser 
> doesn't support cookies. So how does a user session become apparent in 
> the access logs when the visitor's browser does support cookies? I 
> apologize if the answer to this question is painfully obvious...

Are you trying to log that session ID if using cookie-based sessions?

Here's an example from my httpd.conf file for the log format that includes
cookies:
        LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\" \"%{Cookie}i\"" combinedcookie
...which simply adds \"%{Cookie}i\" to log the stock combined log format.
You'll get all cookies stored by your site, but at least you have the session
ID there for use.

Andrew

-- 
Andrew Yochum
Digital Pulp, Inc.
212.679.0676x255
andrew at digitalpulp.com



More information about the talk mailing list