{"action":"created","issue":{"url":"https://api.github.com/repos/nojimage/cakephp-remember-me/issues/8","repository_url":"https://api.github.com/repos/nojimage/cakephp-remember-me","labels_url":"https://api.github.com/repos/nojimage/cakephp-remember-me/issues/8/labels{/name}","comments_url":"https://api.github.com/repos/nojimage/cakephp-remember-me/issues/8/comments","events_url":"https://api.github.com/repos/nojimage/cakephp-remember-me/issues/8/events","html_url":"https://github.com/nojimage/cakephp-remember-me/issues/8","id":345917667,"node_id":"MDU6SXNzdWUzNDU5MTc2Njc=","number":8,"title":"Cookie not decoded","user":{"login":"dype35","id":265407,"node_id":"MDQ6VXNlcjI2NTQwNw==","avatar_url":"https://avatars3.githubusercontent.com/u/265407?v=4","gravatar_id":"","url":"https://api.github.com/users/dype35","html_url":"https://github.com/dype35","followers_url":"https://api.github.com/users/dype35/followers","following_url":"https://api.github.com/users/dype35/following{/other_user}","gists_url":"https://api.github.com/users/dype35/gists{/gist_id}","starred_url":"https://api.github.com/users/dype35/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dype35/subscriptions","organizations_url":"https://api.github.com/users/dype35/orgs","repos_url":"https://api.github.com/users/dype35/repos","events_url":"https://api.github.com/users/dype35/events{/privacy}","received_events_url":"https://api.github.com/users/dype35/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":3,"created_at":"2018-07-30T20:15:43Z","updated_at":"2018-08-01T09:57:01Z","closed_at":null,"author_association":"NONE","body":"hello\r\nThe cookie is saved but not decoded.\r\n\r\nThe site in https\r\ncakephp 3.6.9 (but same problem with 3.6.7)\r\n\r\nThe config : \r\n```\r\n$this->loadComponent('Auth', [\r\n            'authenticate' => [\r\n                'RememberMe.Cookie' => [\r\n                    'userModel' => 'Users',\r\n                    'fields' => ['username' => 'user_login'],\r\n                    'always' => true,\r\n                    //'inputKey' => 'remember_me',\r\n\r\n                    'cookie' => [\r\n                        //'name' => 'rememberMe',\r\n                        //'expires' => '+10 days',\r\n                        'secure' => true,\r\n                        'httpOnly' => false,\r\n                    ],\r\n\r\n                ],\r\n                'Form' =>[\r\n                    'fields' => ['username' => 'user_login','password' => 'user_pass'],\r\n...\r\n```\r\nWhen the user is loged the fist time:\r\n- there is an entry in the databse\r\n- a cookie is created\r\n\r\nWhen the user try to reconnect after some time : \r\n - the cookie is send to the application\r\n - **the cookie is not decoded**\r\nso the user must loggin again\r\n\r\n\r\nI add some debug in your code (but found no solution to correct it) \r\n1st debug  in function checkFields\r\n```\r\n$cookie = $this->getCookie($request);\r\nLog::write('debug',$cookie);\r\n```\r\nI can see : \r\n ```\r\n2018-07-30 21:55:57 Debug: Q2FrZQ==.MGE0YTc3MzJjMzhjMzM1ODg5NjU0M2U5NDZjYzU1YWY5ODczOGRkMmEzZTA0NGYzYjk3OGExMzgzODU0YTFkOfZ/eLunwTFYUBZ7SqIPdBr0d\r\nEVIatGD6l8lOLrftHbE+JcgikbUoAQPBQscnsKm21p3FT3TgHiUWxP96nZAJy8=\r\n```\r\n2nd debug in function checkFields again\r\n```\r\n$decoded = $this->decodeCookie($cookie);\r\nLog::write('debug',$decoded);\r\n```\r\n$decoded variable is empty : \r\n`2018-07-30 21:55:57 Debug: `\r\n\r\nThanks for your help\r\nF."},"comment":{"url":"https://api.github.com/repos/nojimage/cakephp-remember-me/issues/comments/409520938","html_url":"https://github.com/nojimage/cakephp-remember-me/issues/8#issuecomment-409520938","issue_url":"https://api.github.com/repos/nojimage/cakephp-remember-me/issues/8","id":409520938,"node_id":"MDEyOklzc3VlQ29tbWVudDQwOTUyMDkzOA==","user":{"login":"nojimage","id":100564,"node_id":"MDQ6VXNlcjEwMDU2NA==","avatar_url":"https://avatars3.githubusercontent.com/u/100564?v=4","gravatar_id":"","url":"https://api.github.com/users/nojimage","html_url":"https://github.com/nojimage","followers_url":"https://api.github.com/users/nojimage/followers","following_url":"https://api.github.com/users/nojimage/following{/other_user}","gists_url":"https://api.github.com/users/nojimage/gists{/gist_id}","starred_url":"https://api.github.com/users/nojimage/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nojimage/subscriptions","organizations_url":"https://api.github.com/users/nojimage/orgs","repos_url":"https://api.github.com/users/nojimage/repos","events_url":"https://api.github.com/users/nojimage/events{/privacy}","received_events_url":"https://api.github.com/users/nojimage/received_events","type":"User","site_admin":false},"created_at":"2018-08-01T09:57:01Z","updated_at":"2018-08-01T09:57:01Z","author_association":"OWNER","body":"I also tried enabling EncryptedCookieMiddleware.\r\nI saw that the cookie was not decoded, too.\r\nIt's seems this plugins cookie was include binary, then decode failure.\r\n\r\nI'll fix it."}}
{"actor":{"display_login":"nojimage"}}