I am trying to use Spring Security with websockets. As an example, I use spring -websocket-chat ( https://github.com/salmar/spring-websocket-chat ), a demo application from the "Deep dive into websockets" talk. In this application, CookieHttpSessionStrategy uses to store the session identifier stored during authentication. Cookie sends with / info request. Here is the code demonstrating the connection to the server via sockjs (this request sends cookies) https://github.com/salmar/spring-websocket-chat/blob/master/src/main/webapp/js/services.js . I wrote my own client that uses sockjs and stomps, but there are no cookies sent in the / info request. Here is my code
$connectButton.click(function () {
var serverHost = $host.val();
console.log("sockjs created");
stomp = Stomp.over(new SockJS(serverHost));
console.log("stomp over");
stomp.connect({},
function () {
console.log("connected");
},
function () {
console.log("error");
})
console.log("pressed");
});