remove superflous cookie encoding
Finish setting up the shell.
Fix bug in cookie decoding.