Remove cookies
3 posts by 2 authors in: Forums > CMS Builder
Last Post: August 7, 2019 (RSS)
By gversion - July 31, 2019
Hello,
I have a website that users must register in order to access. I would like to not place any cookies on the user's computer until they have logged in (because then they will have registered and in doing so agreed to the cookie policy). I can then avoid needing to place a popup notification message on the website.
Is it possible to stop the website membership login.php and register.php pages placing cookies on the user's machine?
I can see there is the lastUrl and PHPSESSID cookies currently being used on these two pages.
Thanks,
Greg
By daniel - August 6, 2019
Hi Greg,
It should be possible to prevent the 'lastUrl' cookie from being used; you'll need to make sure the following line is commented on the login page:
// if (!getPrefixedCookie('lastUrl')) { setPrefixedCookie('lastUrl', @$_SERVER['HTTP_REFERER'] ); }
And replace all instances of the function "websiteLogin_redirectToLogin()" with "websiteLogin_redirectToLogin(false)".
However, the session cookie (PHPSESSID) is necessary as this is where the login details are stored, and these pages need to check if the user is logged in. Also, more generally, the CMSB core itself initializes the session, so this cookie is going to be set on any CMSB-powered page.
Let me know if you have any other questions.
Thanks!
Technical Lead
interactivetools.com
By gversion - August 7, 2019
Hi Daniel,
Thanks so much for the reply. That seems fairly straightforward... :-)
Regards,
Greg