Sorry for the delayed response, I've been away for a bit.
I can only guess that the issue is being caused something within Codeigniters core upon page refresh.
If you add the following code just after you call the insert_items() function, it shows that the item has been set to the current session data (Which is managed by CI), however, upon page refresh, the session is completely wiped, hence why you're also being logged out.
I can only suggest you put in some kind of custom filter to strip any values with a backslash being added to the cart.
Ideally, when I can get around to it, I will try and include a filter to strip them out before being saved to the session data.