merged cookie into session
updated version