Brief. You want to compose a simple client which receives messages from the server side with STOMP over websockets. Most probably you will face the issue: the default sessionId retrieved from the Session doesn’t match the one assigned by sock.js. We need to go deeper.
Posts Tagged ‘websocket’
![](https://outofrange.ru/wp-content/uploads/2016/06/sockjs-logo_200.png)
Как достать sessionId из вебсокета SockJS?
![](https://outofrange.ru/wp-content/themes/WorldWeb/images/date.png)
![](https://outofrange.ru/wp-content/themes/WorldWeb/images/user.png)
Итак, вам понадобилось получить сгенерированный при конструировании вебсокета идентификатор сессии. Неспешное гугление выдало такое обсуждение: stackoverflow.com. Однако, socket.sessionId оказывается undefined (версия SockJS 0.3.4). Но не всё потеряно.