[UPHPU] MySQL PHP 5 Session-Based Hit Counter

Jacob Wright jacwright at gmail.com
Mon Jan 22 09:30:35 MST 2007

On 1/22/07, Brandon Stout <bms at mscis.org> wrote:
> Jacob Wright wrote:
> > Hey Brandon,
> >
> > I'm not getting any cookies set on any of your pages (i.e.
> > http://bstout.securesites.net isn't working for me either). The
> > headers being sent to my browser are setting the cookie path to /tmp
> > which says if I'm at http://mscis.org/tmp then the cookie will be
> > valid. Make sure your cookie path is set to a plain ol' slash (/).
> >
> > Set-Cookie: PHPSESSID=8oduagb1i4s0lu4r2olkrnkc97; path=/tmp
> >
> > Hope this solves it!
> >
> > Jacob
> >
> >
> > --
> > Jacob Wright
> > Within Code LLC
> I thought the path was for the server-side cookie. I've set the path to
> /, but it's still incrementing every refresh.  It seems both sites
> increment every refresh now.  Any other ideas?

The server is still sending the header "Set-Cookie:
PHPSESSID=5m8of8euqf6pggb7s46jqid8v5; path=/tmp" and setting the cookie at
the /tmp path. Did you restart the server after updating the path?

Also, isn't the point of a session to avoid client-side cookies?

The point of sessions is to keep client state. The cookie holds the session
id in it and the server stores the session information in files (or the
database) with that id. So the information is kept off of the client, but
there still needs to be a way to hook a client (user) up with their session
info. Usually this is done with cookies, but may also be done in the url
with GET variables (slightly less secure).

Jacob Wright
Within Code LLC

More information about the UPHPU mailing list