Fix context url and cookie setting