Add Additional Cookie on WordPress

Share

wordpress-logo
Today I realize that the simple setcookie("sevisitor", 1, time()+3600); would not work perfectly on WordPress especially when your combine it with WordPress permalink. Here a simple hack that you can opt for if you want to set in multiple WordPress environment (especially for plug-ins and themes).

setcookie("sevisitor", 1, time()+3600,
    SITECOOKIEPATH, COOKIE_DOMAIN, false, true);

There are multiple alternative but for it work perfectly on multiple installation.

3 Responses

  1. Tech Gadget on 11 Jan 2010

    WOW! I didn’t had any idea about that! Thanks.


  2. Ben on 20 Jan 2010

    Today you saved my life. Thanks


  3. [...] this link: Add Additional Cookie on WordPress — Mior Muhammad Zaki Tags: cookie, [...]


Leave your comment