Suppression of auto-creation of sessions in RoR, for glory of Europe

I am new to Ruby on Rails, but it seems like it is creating a new session every time a new user visits a website. The problem is that creating a session involves placing cookies in the user's browser, and the problem is that cookies are illegal in Europe !!!

In an exclusive technologically uninformed directive, the user must give his prior consent to any cookie placed on their computer, and if Ruby on Rails immediately sets a cookie, I have no chance to get consent. Immediately after the first visit to my application, the cookie probably has no purpose in terms of the functionality of the website, so the justification for โ€œimplied consentโ€ will also be invalid in court.

So, is it possible to configure the RoR application so that it does not automatically create sessions?

+8
ruby-on-rails cookies session-cookies session
source share
2 answers

There is a library that handles most of this for you: rack-policy

It will destroy all cookies that you / rails try to set if there are no cookies called rack.policy . It also provides browsers with information on whether cookies are currently enabled so you can hide / decorate banners or features as needed.

You might want to note that many websites (like bbc) have used the cookie approach as usual, but by displaying a warning with the word "action" while continuing to use this site, you consent to our use of cookies "(with links to additional information and an option to no longer show a warning).

+2
source share

Here you can learn how to use the Rack middleware to delete sessions and / or all cookies when they exit the door: Rails 3 disables cookies

+1
source share

All Articles