Bugfixes in network.py

* Use % for string formatting instead of &
* Escape cookies
Modify console variables