{"action":"created","issue":{"url":"https://api.github.com/repos/GeniusesOfSymfony/WebSocketBundle/issues/96","labels_url":"https://api.github.com/repos/GeniusesOfSymfony/WebSocketBundle/issues/96/labels{/name}","comments_url":"https://api.github.com/repos/GeniusesOfSymfony/WebSocketBundle/issues/96/comments","events_url":"https://api.github.com/repos/GeniusesOfSymfony/WebSocketBundle/issues/96/events","html_url":"https://github.com/GeniusesOfSymfony/WebSocketBundle/issues/96","id":124102434,"number":96,"title":"WS set anon session for user not anonymous","user":{"login":"anboo","id":7625387,"avatar_url":"https://avatars.githubusercontent.com/u/7625387?v=3","gravatar_id":"","url":"https://api.github.com/users/anboo","html_url":"https://github.com/anboo","followers_url":"https://api.github.com/users/anboo/followers","following_url":"https://api.github.com/users/anboo/following{/other_user}","gists_url":"https://api.github.com/users/anboo/gists{/gist_id}","starred_url":"https://api.github.com/users/anboo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/anboo/subscriptions","organizations_url":"https://api.github.com/users/anboo/orgs","repos_url":"https://api.github.com/users/anboo/repos","events_url":"https://api.github.com/users/anboo/events{/privacy}","received_events_url":"https://api.github.com/users/anboo/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-12-28T18:18:42Z","updated_at":"2015-12-28T18:58:49Z","closed_at":null,"body":"Configuration:\r\n```\r\npdo:\r\n        class: PDO\r\n        arguments:\r\n            dsn: mysql:host=%database_host%;port=%database_port%;dbname=%database_name%\r\n            user: %database_user%\r\n            password: %database_password%\r\n        calls:\r\n            - [ setAttribute, [3, 2] ] # \\PDO::ATTR_ERRMODE, \\PDO::ERRMODE_EXCEPTION\r\n\r\nsession.handler.pdo:\r\n        class:     Symfony\\Component\\HttpFoundation\\Session\\Storage\\Handler\\PdoSessionHandler\r\n        arguments: [@pdo, {lock_mode: 0}]\r\n```\r\n\r\nconfig.yml:\r\n```\r\nframework:\r\n   session:\r\n        # handler_id set to null will use default session handler from php.ini\r\n        handler_id: session.handler.pdo\r\n\r\n......\r\n\r\ngos_web_socket:\r\n    server:\r\n   ...\r\n    client:\r\n        firewall: secured_area #can be an array of firewalls\r\n        session_handler: @session.handler.pdo\r\n```\r\n\r\nTopic code for print username to console\r\n```php\r\npublic function onPublish(ConnectionInterface $connection, Topic $topic, WampRequest $request, $event, array $exclude, array $eligible)\r\n    {\r\n       $user = $this->clientManipulator->getClient($connection);\r\n        $user1 = $this->container->get('security.token_storage')->getToken()->getUser();\r\n        $connection->event($topic->getId(), ['msg' => 'lol, user with name - '.$user1.' - '.$user]);\r\n\r\n        $topic->broadcast([\r\n            'msg' => $event,\r\n        ]);\r\n    }\r\n```\r\n\r\n![Image of Yaktocat]\r\n(http://cs627321.vk.me/v627321008/297b3/pS27cqbuM3Q.jpg)\r\n\r\nBut i not anonymous, why I have a anonymous session? "},"comment":{"url":"https://api.github.com/repos/GeniusesOfSymfony/WebSocketBundle/issues/comments/167628977","html_url":"https://github.com/GeniusesOfSymfony/WebSocketBundle/issues/96#issuecomment-167628977","issue_url":"https://api.github.com/repos/GeniusesOfSymfony/WebSocketBundle/issues/96","id":167628977,"user":{"login":"ProPheT777","id":1763341,"avatar_url":"https://avatars.githubusercontent.com/u/1763341?v=3","gravatar_id":"","url":"https://api.github.com/users/ProPheT777","html_url":"https://github.com/ProPheT777","followers_url":"https://api.github.com/users/ProPheT777/followers","following_url":"https://api.github.com/users/ProPheT777/following{/other_user}","gists_url":"https://api.github.com/users/ProPheT777/gists{/gist_id}","starred_url":"https://api.github.com/users/ProPheT777/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ProPheT777/subscriptions","organizations_url":"https://api.github.com/users/ProPheT777/orgs","repos_url":"https://api.github.com/users/ProPheT777/repos","events_url":"https://api.github.com/users/ProPheT777/events{/privacy}","received_events_url":"https://api.github.com/users/ProPheT777/received_events","type":"User","site_admin":false},"created_at":"2015-12-28T18:58:49Z","updated_at":"2015-12-28T18:58:49Z","body":"if you access to your website from netwoker.dev or something like that and you register websocket to network.dev:8080 it's ok.\r\n\r\nIn the security.yml, what is your firewall name ? secured_area ?"}}