code to destroy zend session gets executed although its not allowed by if else and switch case conditions -


$getid = $this->getrequest()->getparam('id'); // 1 coming url $id_from_cart = 1;   if($getid != $id_from_cart) {         echo "unset session";         zend_session::namespaceunset('cart');  } else {       echo "dont unset";  } 

when use $getid = 1 static value, working fine if use $this->getrequest()->getparam('id') value 1 although goes in else condition in both cases unsets session (code written in if condition). how possible, code destroy session has been written in if condition. have tried many things couldn't reach anywhere. suggestion great help. have tried switch case, in_array , if else.

try

$getid = (int) $this->getrequest()->getparam('id'); 

Comments

Popular posts from this blog

c# - DetailsView in ASP.Net - How to add another column on the side/add a control in each row? -

javascript - firefox memory leak -

Trying to import CSV file to a SQL Server database using asp.net and c# - can't find what I'm missing -