fix issue #140 (302 + cookie request) + change utils functions