title: JavaFX Separate Sessions / Cookies
body: <p>I'm quite new to Java and JavaFX and as such I think I'm a bit out of my depth.</p>
  
  <p>I've got a basic application at the moment that houses two WebViews <code>view1</code> and <code>view2</code>, each using a separate WebEngine <code>engine1</code> and <code>engine2</code>. What I'd hoped was that by using different WebEngines I would be given separate sessions between them, not shared. </p>
  
  <p>Put simply, I'd like to log into the same domain with two different accounts in one Window.</p>
  
  <p>I've had a play with <code>java.net.CookieManager</code> and <code>java.net.CookieHandler</code> but I don't quite think I'm barking up the right tree with those.</p>
  
  <p>As far as I can find in the JavaFX documentation I can seem to find any sort of Web Session Provider / Handler like there is in some tools like Awesomium/Visual Studio. I'm hoping someone can either tell me the right place to look for such a class or possibly help me to make one. </p>
  
  <p>Application code is as follows, all help is much appreciated </p>
  
  <pre><code>public void start(Stage primaryStage) {
  
          //Create a GridPane for browser panes
          GridPane browserGrid = new GridPane();
          browserGrid.setGridLinesVisible(true);
          browserGrid.setPrefSize(primaryStage.getWidth(), primaryStage.getHeight());
  
          browserGrid.setHgap(10);
          browserGrid.setVgap(10);
          browserGrid.setPadding(new Insets(0, 10, 0, 10));
  
          java.net.CookieManager manager1 = new java.net.CookieManager();
          java.net.CookieHandler.setDefault(manager1);
  
          WebView view1 = new WebView();
          WebEngine engine1 = view1.getEngine();
  
          WebView view2 = new WebView();
          WebEngine engine2 = view2.getEngine();
  
  
          engine1.load("https://www.facebook.com");
          engine2.load("https://www.facebook.com");
  
          browserGrid.add(view1, 0, 1);
          browserGrid.add(view2, 1, 1);
  
  
          //playerGrid.setGridLinesVisible(true); 
          Scene scene = new Scene(browserGrid, 1600, 800);  
          primaryStage.setTitle("MultiPane Browser"); 
          primaryStage.setScene(scene); 
          primaryStage.show();
      }
  </code></pre>
  
  <p>Just using Facebook as the default site to log in to for the sake of testing</p>