[pmwiki-users] Cookies, EnablePathInfo, and so on....

Patrick R. Michaud pmichaud at pobox.com
Tue Sep 20 12:38:49 CDT 2005

On Tue, Sep 20, 2005 at 01:31:50PM -0400, Russell Bailey wrote:
> >Also, as of 2.0.6 it's convention to prefix cookies with $CookiePrefix,
> >thus I'd use
> >
> >   $RichEditCookie = $CookiePrefix.'editor');
> >   setcookie('editor', $value, 0, $AuthorCookieDir)

Oops!  I *meant* to write

    SDV($RichEditCookie, $CookiePrefix.'editor');
    setcookie($RichEditCookie, $value, 0, $AuthorCookieDir)

> Unfortunately,  it looks like I didn't make that mistake in my actual 
> code.  The line is
> setcookie('editor', $value, $AuthorCookieExpires,  $AuthorCookieDir);
> As for sites with author tracking disabled,  what would you suggest?  
> Should I still try and inherit the administrator's existing 
> preferences,  or set them totally separately?

Maybe we should have generic $CookieExpires and $CookieDir
variables, along with $CookiePrefix, instead of creating separate
values of this parameter for every cookie.

For now, it's probably safe to assume that something like this
will be the case, so I suggest:

    SDV($RichEditCookie, $CookiePrefix.'editor');
    SDV($CookieDir, '/');

    setcookie($RichEditCookie, $value, 0, $CookieDir);


More information about the pmwiki-users mailing list