[eluser]lookatthosemoose[/eluser]
Are session variables not accessible when calling a controller function via ajax?
For instance, I have an AJAX request that increments a DB field.
The controller function is being called via AJAX, and in that function I'd like to use existing session data, but when I attempt to echo out session variables, I get nothing. See below.
Code:
[removed]
new Ajax("<?=site_url('landing/increment/clickcount')?>").request();
Code:
function increment(){
echo "userID is: " . $this->session->userdata('user_id');
$field = $this->uri->segment('3');
$value = "$field + 1";
$params = array($field => $value);
echo $this->respondent->update_field($params);
}
When viewing the AJAX response in Firebug, I only get:
Quote:userID is:
SO does that mean session variables are not available there?
I'm using native sessions not the standard CI sessions.
Thanks
E