• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Session problem! PLS help!

#1
[eluser]bogdan3l[/eluser]
Hello!

I have a problem with the ci session library in internet explorer 6-7(8 not tested).

I give you a quick example what i want to do.
==========================================================================================
class Welcome extends Controller {

function __construct()
{
parent::Controller();

$this->load->helper('url');
$this->load->library('session');
}

function index()
{
echo $this->session->flashdata('test');
}

function blabla()
{
$this->session->set_flashdata('test', 'Hello world!');
redirect('');
}
}
==========================================================================================

Ok, in other browsers everything is ok (when i access http://localhost/welcome/blabla i am redirected to http://localhost/ and i see the Hello world!).

In IE 6-7 i am redirected to http://localhost/ but i don't see the Hello world! but, if i give a refresh to the page then i see the Hello world!.

Could someone help me to solve this? Please! I am stuck with my project.

Thank you!

#2
[eluser]xeroblast[/eluser]
try using redirect('','refresh')...

#3
[eluser]bogdan3l[/eluser]
Thank you for your reply.

Your method is working but, only first time.

If i access http://localhost/welcome/test i see the Hello world! but if i access again http://localhost/welcome/test i don't see the Hello world!.

Thank you again!

#4
[eluser]xeroblast[/eluser]
i dont know about that but i think bcoz youre using session flashdata... try another one... not the flashdata...

#5
[eluser]bogdan3l[/eluser]
Thank you for you reply.

I will try right now.

#6
[eluser]brooky_agb[/eluser]
I've had the same problem for weeks.. No solution found.

#7
[eluser]bogdan3l[/eluser]
I can't test your second method because i want the message to be shown only one time.

In test function i do:
=============================================================================================
$this->session->set_userdata('test', 'Hello world!');
redirect('/welcome');

And in index function:
=============================================================================================
echo $this->session->userdata('test');

But then i can't remove de Hello world!.

If i do $this->session->sess_destroy(); i get the header error, the same for unset_userdata.

Thank you again for your reply.


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


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