I want to set session id using pin column my query result and check to see whether the session was set to that value on the next page, Here is my code
<?php
require_once('AppLogin_Class.php');
$success='';
if(isset($_POST['submit'])){
$pin=$_POST['SIDN'];
$status=0;
try{
require_once('connection.php');
$message='Invalid Application Pin';
$STH=$db_conn->prepare("SELECT * FROM pins WHERE pin=? && status=?");
$STH->bindParam(1,$pin);
$STH->bindParam(2,$status);
$STH->execute();
$row=$STH->fetch();
if($STH->rowCount()==1){
$_SESSION['id']=$row['pin'];;
echo '<meta http-equiv="refresh" content="=1;applicants/upload_pass.php?pin=$pin"/> ';
}else{
return $message;
}
}catch(PDOException $e){
echo $e->getMessage();
}
}
?>
Here is my next page verification code
<?php
$pin=$_GET['pin'];
require_once('class_applicants.php');
if(!isset($_SESSION['id'])){
echo '<meta http-equiv="refresh" content="=1;../appHome.php"/> ';
}else{
//success page here
}?>
Someone should help me to check while the page is loging me out because of session id