Fix broken parsing on session cookie

* Modifications to support IPv6 left it so it didn't work
  properly on either IPv4 or IPv6.