Welcome Guest, Not a member yet? Register   Sign In
Session Problem in CI 1.6.3. : disallowed SQL string
#1

[eluser]Unknown[/eluser]
Before using any framework, I used to use $_SESSION[] to save an SQL string to remember the last query, this is helpful for me to store any filter when a user perform a search within some data (for example, employee data). So far, I found no problem with the usage of that native PHP session.

in CI, I used command like this:
Code:
$this->session->set_userdata("key1", "colum_name LIKE '%some_string%'");

when I check session in the next request, I wonder why all the session data were destroyed.
I try to modify the SQL string to be like this:
Code:
"LIKE '%%'"
that's no problem..

the question is:
1. why can this happened?? is it about the encryption process when CI store session data to the cookie?
2. has the problem been solved in CI version 1.7.1?
3. can I store an array value within session? like this:
Code:
$this->session->set_userdata("key1", array("key"=>"value"));



thank you ... :-)
#2

[eluser]Dam1an[/eluser]
I have no idea why thats happening, and have never seen anything like it :S
The only way to find out if its been fixed in 1.7.1 is to try it

And you can store arrays in sessions (although remember there's a 4K limit, so keep it small if you're not using the database), but you need to assign it to a variable before accessing the array variables




Theme © iAndrew 2016 - Forum software by © MyBB