master Added cookies handling into js