codeigniter session variable taking controller name instead of assigned variable |
[eluser]Unknown[/eluser]
I've come across a problem where my session variables are taking the name of the controller, instead of the variable assigned.. For example when calling the following URL www.example.com/newprop/editprop/1 Code: class Newprop extends CI_Controller { I would expect the session info in the database to be Code: s:8:"propid";i:1:1; Code: s:8:"propid";s:7:"newprop"; If I immediately echo the session data after setting it... Code: $this->session->set_userdata(array("propid"=>$propid)); I get "1" even though this is not stored in the DB, but if I try to echo the session data from another controller, I get the string "newprop" I'm storing session info in the database. If I forgot any other useful information please let me know. EDIT: If I remove the $this->index($returnvalue); from the editProp() method, the session is set correctly... Not sure if I'm at fault or if CI is EDIT 2: Problem solved, I had an ajax request that was calling www.example.com/newprop/editprop/newprop/...... which was setting the session variable a 2nd time. incorrectly.... now how do I delete this post...? |
Welcome Guest, Not a member yet? Register Sign In |