[eluser]Kepi[/eluser]
I'm currently using the Encryption class for placing things like database record primary keys into hidden form fields and the like by way of the encode() function. It's working quite well as someone viewing the source of the page will see things like:
Code:
value="B0pYWVdJDE8GSlQJUV8BbFNkBDJQNAgxVTQBZFNjBGU="
However, a handful of my controller functions that get run via AJAX calls also take these encoded keys as parameters, and very occasionally the encoded value includes a slash. Naturally, CI will interpret that as multiple parameters and I only get part of the value into my function.
The appearance of '=' and '+' in the encoded values prompted me to just add those two characters to my allowed URI character list (as hesitant as I was to do so), but of course I can't do that with '/'. Is there any way, perhaps by changing the cipher used by the Encryption class, to still use encode()/decode() for my purposes without having to worry about slashes appearing in the values? Or do I need to look at implementing my own encode()/decode() pair?
I had considered sticking the various keys (there can be dozens on a single loaded page) into session variables, but that would amount to a bit of a headache managing which ones were set and where.
Thanks!