Welcome Guest, Not a member yet? Register   Sign In
Using flashdata after redirect?
#11

(11-17-2015, 12:21 PM)Martin7483 Wrote: Have you tried
PHP Code:
var_dump($_SESSION); 

After setting it?

PHP Code:
$this->session->set_flashdata('message''test');
var_dump($_SESSION);
exit;
redirect('login''refresh'); 

Is the message available in the $_SESSION array?

I checked this and yes, the message is available in the $_SESSION array:

Code:
array (size=3)
 '__ci_last_regenerate' => int 1447806257
 'message' => string 'Update successful.' (length=18)
 '__ci_vars' =>
   array (size=1)
     'message' => string 'new' (length=3)

This was the dump before the redirect.

(11-17-2015, 01:36 PM)ivantcholakov Wrote: Is there an AJAX request? Maybe it somehow captures and clears the flashdata before the redirection?

A side note:
When AJAX is called by jQuery
headers["X-Requested-With"] = "XMLHttpRequest";
is done automatically, but in other cases this header might be forgotten.

No, there is no AJAX request. It is a normal form submission (POST request).
Reply


Messages In This Thread
Using flashdata after redirect? - by JayAdra - 11-17-2015, 12:48 AM
RE: Using flashdata after redirect? - by arma7x - 11-17-2015, 01:04 AM
RE: Using flashdata after redirect? - by JayAdra - 11-17-2015, 01:08 AM
RE: Using flashdata after redirect? - by JayAdra - 11-17-2015, 02:21 AM
RE: Using flashdata after redirect? - by Sentro - 11-17-2015, 04:41 AM
RE: Using flashdata after redirect? - by JayAdra - 11-17-2015, 07:34 AM
RE: Using flashdata after redirect? - by Bhavesh - 11-17-2015, 05:33 AM
RE: Using flashdata after redirect? - by JayAdra - 11-17-2015, 06:49 PM
RE: Using flashdata after redirect? - by JayAdra - 11-17-2015, 05:28 PM
RE: Using flashdata after redirect? - by JayAdra - 11-17-2015, 09:15 PM
RE: Using flashdata after redirect? - by flubadub - 04-22-2016, 11:10 PM
RE: Using flashdata after redirect? - by Mariya - 03-10-2018, 01:12 AM



Theme © iAndrew 2016 - Forum software by © MyBB