• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Not loading page due to session

#1
[eluser]Gerep[/eluser]
Hi,

I have a session on my View with some data about files and every time I click the link to load this view it does nothing, its like I'm not clicking on the link but if I comment the line in the Controller that create the session and populate it, it works perfectly.

The session is been loaded and working and I know that because I have to login to get access to that View.

Piece of code
Code:
Controller

function list_files()
{
  $this->load->model('filesModel');
  $query = $this->filesModel->list_files();
  $this->session->userdata('files_list', $query);
}

Code:
Model

function list_files()
{
  return $this->db->query("SELECT * FROM files");
}

In the View I show the data like this:
Code:
foreach($this->session->userdata('files_list') as $files)
{
echo $files->name.'<br />';
}


When I comment the controller line
Code:
$this->session->userdata('files_list', $query);
or change it to
Code:
$this->session->userdata('files_list', 'test');
it works =(

Thanks in advance.


Messages In This Thread
Not loading page due to session - by El Forum - 01-10-2011, 08:12 AM
Not loading page due to session - by El Forum - 01-10-2011, 09:31 AM
Not loading page due to session - by El Forum - 01-10-2011, 09:47 AM

Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2020 MyBB Group.