change $window.location to work with proxy and cookie