Added cookie guards.
Fixed refresh timeout value.