added url encoding to cookie values
switched to rawurlencode for cookie values