Drupal session issue
I try to pass or redirect 1 item from a 'form', it's maybe not the best way to do by $_SESSION:
But, my problem is that the session on the specific page is empty. I clarify my explanation with code..
//store my drupal form table in the session, with var_dump() I can see the data. => 开发者_C百科$_SESSION['sol_planning']
is not empty!
function planning_view_page() {
//$sol_planning = $form['solution']['#sol'];
$_SESSION['sol_planning'] = $form['solution']['#sol'];
return $form; }
//On my other page, (where I want to display the table). the same session variable is null.
function planning_view() {
$sol_planning = $_SESSION['sol_planning'];
var_dump($sol_planning);
return $sol_planning;}
Have someone an explanation for this issue, I hope my question is clear.
You should use drupal session api for this.
You can use sess_write
and sess_read
.
You could try to use session_start()
精彩评论