[webapi] Fix python script security for webtestingservice

- Update 4 script to catch exception
- Set "HttpOnly" to all cookies