Implemented monkey patch from bossylobster

http://stackoverflow.com/questions/15690831/cloud-endpoints-http-cookies/15693618?noredirect=1#comment22310322_15693618