How/where is the $_SESSION['memberid'] var being created? I'd say the session is not being created or has no value. What outputs when you try to echo the value of $_SESSION['memberid'] on the download.php page? IE just do something like this at the top of download.php
<?php echo "value of memberid= ".$_SESSION['memberid']; exit(); ?>
If it doesn't output a value, then there's your problem. To share your sessions between pages, session_start(); is required before referencing your session variables and resuming the current session.
Try changing your code to this:
<?php
session_start();
$reqAgcID = $_REQUEST['reqAgcID'];
if(!isset($_SESSION['memberid']) || ($_SESSION['memberid'] == ''))
{
header("Location:login.php?msg=logfirst");
exit;
}
Note: I left the PHP tag open like in your example.