transparencia Posted October 21, 2009 Share Posted October 21, 2009 Greetings ! I want users to agree on a document... //Document.PHP file if( $kernel->vars['document_agree'] == true ) { $_SESSION['document_agree'] = true; header( "Location: download.php?id=" . $kernel->vars['file_id'] ); exit; } ....and then be allowed to donwload: //Download.PHP file if( !isset( $_SESSION['document_agree'] ) AND $category_doc_id > 0 ) { header( "Location: document.php?id=" . $category_doc_id . "&file_id=" . $kernel->vars['id'] ); exit; } I want to pass the session variable from document.php to download.php. I've declared the session variable in the download.php file and it works fine so I assume the session variable is not passing through. What can be wrong? Link to comment https://forums.phpfreaks.com/topic/178542-solved-session-variable-not-passing/ Share on other sites More sharing options...
cags Posted October 21, 2009 Share Posted October 21, 2009 Do you have session_start() at the top of both scripts? Link to comment https://forums.phpfreaks.com/topic/178542-solved-session-variable-not-passing/#findComment-941606 Share on other sites More sharing options...
transparencia Posted October 21, 2009 Author Share Posted October 21, 2009 Oops. No and that was the problem. Thanks! Link to comment https://forums.phpfreaks.com/topic/178542-solved-session-variable-not-passing/#findComment-941611 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.