Fixing webui Remote Access.

Setting the web ui to have remote access causes the site to hang on "Connecting to  WebSocket Server" if the WebSocketPort is defined in the user config. This is because pts-web-socket.js did not use the port in $PTS_WEBSOCKET_PORT, it just used the port that the webui was running on minus one. I have updated index.php to update the cookie with the ENV variable before the loader is run, and I have changed pts-web-socket.connect() to read the webserver location from said cookie.