in reply to How I get cookie value

SSI runs your script to get the text and includes that text. It does *not* include your perl-Script into another one. And your script as SSI can *not* prevent the including file from being sent.