Welcome Guest, Not a member yet? Register   Sign In
[SOLVED] Session, flashdata under HTTPS
#1

[eluser]Unknown[/eluser]
Hi all,

I'm having a problem with flashdata.
In my app I have both HTTP and HTTPS depending on the controller where I am.
In HTTP there is no problem and all works as expected... in HTTPS the flashdata doesn't show up after a form submission for example.

Its a very strange situation, if I use the same controller over HTTP its all fine and over HTTPS it just don't work...

Any help/suggestion?



Thanks,
Hélder
#2

[eluser]groggster[/eluser]
I had this same problem when using ion-auth.

The problem is that you probably do a redirect like:

Code:
redirect('auth/login', 'refresh');

and probably that gets redirected again to https.

you will lose flashdata after two redirects, so my solution was to make only one redirect.

In my config.php file i added:

Code:
$config['base_url_ssl'] ="https://your_url_goes_here/";

and then replaced my redirect with:

Code:
redirect($this->config->item('base_url_ssl').'auth/login', 'refresh');


Hope this helps someone.

Happy Codeigniting!!
#3

[eluser]Unknown[/eluser]
Hi Groggster,

Thanks for the reply. I manage to solve the problem in the force_ssl helper file by putting:
Code:
$this->session->keep_flashdata('message');
when changing from https to http and vice versa.
And, for the record, remember to change the base_url for the https when submiting forms! Big Grin

Thanks again!




Theme © iAndrew 2016 - Forum software by © MyBB