{"action":"created","issue":{"url":"https://api.github.com/repos/playframework/playframework/issues/4752","labels_url":"https://api.github.com/repos/playframework/playframework/issues/4752/labels{/name}","comments_url":"https://api.github.com/repos/playframework/playframework/issues/4752/comments","events_url":"https://api.github.com/repos/playframework/playframework/issues/4752/events","html_url":"https://github.com/playframework/playframework/issues/4752","id":90710413,"number":4752,"title":"@AddCSRFToken won't let us create new cookie on initial load of session","user":{"login":"cblaze22","id":556494,"avatar_url":"https://avatars.githubusercontent.com/u/556494?v=3","gravatar_id":"","url":"https://api.github.com/users/cblaze22","html_url":"https://github.com/cblaze22","followers_url":"https://api.github.com/users/cblaze22/followers","following_url":"https://api.github.com/users/cblaze22/following{/other_user}","gists_url":"https://api.github.com/users/cblaze22/gists{/gist_id}","starred_url":"https://api.github.com/users/cblaze22/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cblaze22/subscriptions","organizations_url":"https://api.github.com/users/cblaze22/orgs","repos_url":"https://api.github.com/users/cblaze22/repos","events_url":"https://api.github.com/users/cblaze22/events{/privacy}","received_events_url":"https://api.github.com/users/cblaze22/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":5,"created_at":"2015-06-24T15:30:19Z","updated_at":"2015-07-10T20:49:18Z","closed_at":null,"body":"The cookies below called TEST wont get set because of the AddCSRToken.  Why cant I modify the response if this is being executed on first page load where the Play session is created.  If I remove this attribute, it works.\r\n\r\n```\r\n@AddCSRFToken\r\n\tpublic Promise<Result> post(String version) {\t\t\t\r\n\t\tfinal LaunchRequest launchRequest = new LaunchRequest(request().body().asFormUrlEncoded(), false);\r\n\t\t\r\n\t\tPromise<ConsumerInstance> promiseOfConsumerInstance = null;\r\n\t\ttry {\r\n\t\t\tpromiseOfConsumerInstance = consumerInstanceDAO.getByConsumerKey(new ConsumerKey(launchRequest.getOauth_consumer_key()));\r\n\t\t} catch (DataAccessException e) {\r\n\t\t\tLogger.warn(e.getMessage());\r\n\t\t}\r\n\t\t\r\n\t\tif (promiseOfConsumerInstance != null) {\r\n            Map<String, String> paramMap = launchRequest.toSortedMap();\r\n\r\n            try {\r\n                response().setCookie(\r\n                        \"TEST\", CookieUtils.serializeParameters(paramMap), null, \"/lti/debug\", null, false, true);\r\n            } catch (Exception e) {\r\n                Logger.warn(e.getMessage(), e);\r\n            }\r\n\r\n            return promiseOfConsumerInstance.map(new ConsumerInstanceFunction(launchRequest)).recover(new RecoverFunction(launchRequest));\r\n\t\t}\r\n\t\telse {\r\n\t\t\treturn null;\r\n\t\t}\r\n\t}\r\n```"},"comment":{"url":"https://api.github.com/repos/playframework/playframework/issues/comments/120519906","html_url":"https://github.com/playframework/playframework/issues/4752#issuecomment-120519906","issue_url":"https://api.github.com/repos/playframework/playframework/issues/4752","id":120519906,"user":{"login":"cblaze22","id":556494,"avatar_url":"https://avatars.githubusercontent.com/u/556494?v=3","gravatar_id":"","url":"https://api.github.com/users/cblaze22","html_url":"https://github.com/cblaze22","followers_url":"https://api.github.com/users/cblaze22/followers","following_url":"https://api.github.com/users/cblaze22/following{/other_user}","gists_url":"https://api.github.com/users/cblaze22/gists{/gist_id}","starred_url":"https://api.github.com/users/cblaze22/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cblaze22/subscriptions","organizations_url":"https://api.github.com/users/cblaze22/orgs","repos_url":"https://api.github.com/users/cblaze22/repos","events_url":"https://api.github.com/users/cblaze22/events{/privacy}","received_events_url":"https://api.github.com/users/cblaze22/received_events","type":"User","site_admin":false},"created_at":"2015-07-10T20:49:18Z","updated_at":"2015-07-10T20:49:18Z","body":"I guess no one tests older versions of Play.\r\n"}}