The problem goes like this. When a new user comes to the site, a record is created in the customer table. And a cookie named .Smart.Visitor is kept with the value of CustomerGuid.
The user registers to the site and registers with the same CustomerGuid. Normally, when this user logs out, a new registration and customerguid is required, but a new guid is not created. Therefore the session hangs.