Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author Mej de Castro

    (@mej)

    Hi @justin-bigscoots , Thanks for using LoginWP!

    The cookie was use for saving a certain session id and then the session id was used in for tracking and for saving/updating database. Meanwhile, no cookie was added in browser, so it was accessible in all pages. Few certain pages like the login/logout are using it, though.

    The team is reviewing this case further to not affect with the speed performance of the website.

    Stay tuned!

    Hi @mej,
    I totally understand that you are using cookies to store the session ids but the problem is if we try to cache the page at the CDN level, it won’t be possible to do because CDNs will refuse the cache the Page HTML as long as the response header has set-cookie in it, because it will think that the page content is dynamically dependent on the cookie value.

    To mitigate this problem and making sure the pages are long term cache friendly, I would suggest implementing the following approaches:

    1. Instead of setting the cookies at the PHP level which causes set-cookie in the Response Header, please handle it at the JavaScript level.
    2. You can either take advantage of the browser’s LocalStorage or SessionStorage API to store the data. But for some reason if you must need to use Cookies, then please set the cookies at the JS level as this will not add the set-cookie header and the page can be cached. Link: https://developer.mozilla.org/en-US/docs/Web/API/Document/cookie
    3. You can add an Ajax call to pass the cookie or localstorage data to PHP from your JS script.

    If you implement these recommendations, you can still do all the tracking that you are doing but instead of using PHP to setup the cookies, doing that at the JS level so the page HTML can be cached for long term without hampering anything.

    Hope this helps. ??

    Plugin Author Mej de Castro

    (@mej)

    Hi @justin-bigscoots @isaumya , Thank you for bringing this to our attention. We will release new version that addresses this case soon.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Cookie’ is closed to new replies.