• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Flash data, Redirect and a Blank Screen

#1
[eluser]Clooner[/eluser]
I never had to use flash data before but now I need to save some post data after a redirect. However when I set the flash data using $this->session->set_flashdata($key,$value) I get a blank screen on the page I get redirected to.

How is this possible or am I using the flash data wrong?

This is how I save the data and do a redirect to a different function in the controller
Code:
if ($this->input->post('price'))
    $this->session->set_flashdata('price', $this->input->post('price'));
if ($this->input->post('relation'))
    $this->session->set_flashdata('relation', $this->input->post('relation'));
if ($this->input->post('category'))
    $this->session->set_flashdata('category', $this->input->post('category'));
redirect('import/step2/'.$data['file_name']);

At this stage I do not even try to access the flash data on the page I get redirected to. When I remove the set_flasdata calls everything gets displayed just fine

#2
[eluser]alboyd[/eluser]
That seems very strange - is it possible more than one of those could evaluate to true? I can't think why - but perhaps it doesn't like to have flashdata set more than once before a redirect?

#3
[eluser]steelaz[/eluser]
Anything in the error logs?

#4
[eluser]Clooner[/eluser]
[quote author="steelaz" date="1251049977"]Anything in the error logs?[/quote]

I checked the error logs and the weird thing is that whenever I try to use the flash data I get the following error. Which has to do with memory management.

Code:
[23-Aug-2009 15:00:44] PHP Fatal error:  Allowed memory size of 8388608 bytes exhausted (tried to allocate 676864 bytes) in Unknown on line 0

When I check the profiler the memory usage without the flashdata is 4 meg. I only try to save one float value and two int values how would it be possible for the flashdata to consume that much memory

#5
[eluser]Clooner[/eluser]
I set the memory usage higher by using
Code:
ini_set("memory_limit","32M");
and this fixes the problem

but flashdata shouldn't be using that much memory right?

#6
[eluser]alboyd[/eluser]
Use the database for sessions imo. It saves heaps of heartache and gives you so much more room to store data in your sessions.


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


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