No session in Websockets


(Avzlobin79) #1

It is ok.

 public Result login() {
	   
    	
    	session("user", "alex@gmail.com");
	    return ok("Welcome!->"+session().toString()+"request:"+request().remoteAddress());
	}
    public Result get() {
	    
	    return ok("Get!->"+session().toString()+"request:"+request());
	}

But,I got here empty session after setting session(see above)

 public WebSocket socket() {
	    return WebSocket.Text.acceptOrResult(request -> {
	    	System.out.println(request.asScala().id());
	    	System.out.println(session());
	    	
	    	if (session().get("user") != null) {
	            return CompletableFuture.completedFuture(