I would be interested in disabling session cookies, too. Also there is a setting session.enabled in user/config/system.yaml, setting it to false throws an error ("Server Error ... 0 - The Login plugin requires "system.session" to be enabled"). Since the login plugin is required if using the admin UI, it's not possible to disable session cookies even for pages not containing any form.
However, it should be possible to suppress session cookies for regular web pages not containing forms, shouldn't it? Pages with forms such as login pages could override the session.enabled setting explicitly or implicitly.
create a subdomain (e.g. static.domain.com) and move all of static files into the subdomain folder (e.g. static.domain.com folder)
update my theme url link that serve static files into my new subdomain (e.g. static.domain.com/styles.min.css)
recheck again on gtmetrix.com, the result is static files still in cookie domain while the static url is point to subdomain (e.g. static.domain.com/styles.min.css)
@chris_jung:
You could use different environments. Use ‘admin.yoursite.com’ with cookies and disable cookies for yoursite.com.
Problem are restricted and contact pages in the yoursite.com domain still requiring session cookies. It would be possible to just enable session for those pages, but if I understand it correctly, code in the login plugin has to be changed for this, since the login plugin checks for the session.enabled setting globally (file user/plugins/login/login.php, lines 69-72).
Finally I just commented "throw new \RuntimeException('The Login plugin requires "system.session" to be enabled');" on line 81 (file user/plugins/login/login.php) and set session.enabled to false in user/config/system.yaml.
In fact the system only checks if session is enabled to get "an authorization".
If you don't check system.session, the login plugin will create the session too.
I also am interested in creating a cookie-free site (because I don't see why it would need one and GDPR makes cookies a bit of a hassle). I just tried what you suggested @arank, but the grav-site cookie still pops up again. I tried clearing the cache but to no avail. How do I get rid of that cookie?
EDIT: I am so sorry! I uploaded it into the wrong directory… 😅 Now that's fixed, the cookie is gone and everything is working like a charm. So thank you very much @arank!
I tried this because I only want cookies when login plugin is being used and not for anonymous users, but ticking box remember me results in error page and not ticking it doesn't get you logged in. Am i missing something here?
The reason I want this is because I am picking a fight with Varnish...as a trial-and-error-dude I really shouldn't, but I can't let go