CodeIgniter icon indicating copy to clipboard operation
CodeIgniter copied to clipboard

CI > Session > function _serialize($data) + _unserialize($data)

Open bitbucket-import opened this issue 15 years ago • 1 comments

Hi there,

I found a really nasty problem using the internal session-store of codeigniter...

The problem is, that if I want to store a quote ("), the session-string gets destoryed!

You could use json_encode and json_decode for the function. I was overloading your both functions by:

{{{

!php

function _unserialize($data) { return json_decode($data, true); }

function _serialize($data) { return json_encode($data); }

}}}

and everything is fine... keep on running ;-)

with best regards,

Patrick ([email protected])

bitbucket-import avatar Aug 19 '11 14:08 bitbucket-import

I'm pretty sure this works now.

philsturgeon avatar Apr 26 '12 20:04 philsturgeon