[eluser]WanWizard[/eluser]
The session class rotates the session_id by default every 300 seconds, set by the update parameter in the config. If that happens, the cookie is updated as well.
However, if you use Ajax to update your cart, you can run into the problem that rotation happens on an ajax call, in which case you might lose the session. This is a known bug, it's been there for years.
Search here for "is_ajax" and "sess_update" on how to disable this rotation on ajax calls.