Skip to main content

2. – Connect to a RDP server using cookies

Modify your index.page.js from 1. as the followings:

window.onload = function() {
  document.cookie = "gateway=192.168.12.111' ";
  document.cookie = "server=192.168.12.117";
  document.cookie = "user=userName";
  document.cookie = "pwd=password";
  var r = new svGlobal.Rdp2();
  r.addSurface(new svGlobal.LocalInterface());
  r.run();
};

You should use server side technologies (JSP, ASP.net, PHP etc) to save the cookie.

Pros: Parameters are saved in the cookies and user will not see it in the URL.
Cons: User’s browser may have cookies disabled. User can still see the parameters by checking the value of the cookies.