{"action":"closed","issue":{"url":"https://api.github.com/repos/prey/gdpr_rails/issues/11","repository_url":"https://api.github.com/repos/prey/gdpr_rails","labels_url":"https://api.github.com/repos/prey/gdpr_rails/issues/11/labels{/name}","comments_url":"https://api.github.com/repos/prey/gdpr_rails/issues/11/comments","events_url":"https://api.github.com/repos/prey/gdpr_rails/issues/11/events","html_url":"https://github.com/prey/gdpr_rails/issues/11","id":321235775,"number":11,"title":"How to store cookie consent ?","user":{"login":"EtienneDepaulis","id":639743,"avatar_url":"https://avatars2.githubusercontent.com/u/639743?v=4","gravatar_id":"","url":"https://api.github.com/users/EtienneDepaulis","html_url":"https://github.com/EtienneDepaulis","followers_url":"https://api.github.com/users/EtienneDepaulis/followers","following_url":"https://api.github.com/users/EtienneDepaulis/following{/other_user}","gists_url":"https://api.github.com/users/EtienneDepaulis/gists{/gist_id}","starred_url":"https://api.github.com/users/EtienneDepaulis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/EtienneDepaulis/subscriptions","organizations_url":"https://api.github.com/users/EtienneDepaulis/orgs","repos_url":"https://api.github.com/users/EtienneDepaulis/repos","events_url":"https://api.github.com/users/EtienneDepaulis/events{/privacy}","received_events_url":"https://api.github.com/users/EtienneDepaulis/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":3,"created_at":"2018-05-08T15:28:54Z","updated_at":"2018-05-15T01:06:17Z","closed_at":"2018-05-15T01:06:17Z","author_association":"CONTRIBUTOR","body":"The method explaine in the readme does not seem to work (or even exist):\r\n\r\n```ruby\r\n@user.store_policy_cookie if cookies[\"policy_rule_cookie\"] == \"accepted\"\r\n```\r\n\r\nI had to do something like this to make it work:\r\n\r\n```ruby\r\nclass ApplicationController < ActionController::Base\r\n\r\n  protected\r\n\r\n  def after_sign_in_path_for(user)\r\n    handle_cookie_policy_for(user) if cookies[\"cookieconsent_status\"] == \"dismiss\"\r\n\r\n    super(user)\r\n  end\r\n\r\n  def handle_cookie_policy_for(user)\r\n    rule_name = \"cookie\"\r\n\r\n    return if !user.needs_policy_confirmation_for?(rule_name)\r\n\r\n    term = user.policy_term_on(rule_name)\r\n    user.handle_policy_for(term).accept!\r\n  end\r\nend\r\n```\r\n\r\nShould the Readme be updated or is it me not using correctly this method ?\r\nThanks for your help"}}
{"actor":{"display_login":"michelson"}}