php会话不在链接上工作

here is the code that i am using for session.

<?php
    $inactive = 600;
// check to see if $_SESSION['timeout'] is set
    if(isset($_SESSION['timeout']) ) {
    $session_life = time() - $_SESSION['timeout'];
    if($session_life > $inactive)
    { 
    session_destroy();
    }

    else
    {
    echo "<script>function multiclick()
    {
    document.getElementById('Image9').style.display='none';

     }
    </script>";
    }
    }
    $_SESSION['timeout'] = time();
    ?>

actuly i want that when i click on link once it will be hide.but it is nor working.here is link of my page and link on that i am working is love it. http://shoppingmore.com.hk/index.php?option=com_shopsearch&view=shopdetails&shop_id=139

please any help.thanks in advanced.

use session_start() at the top of code

<?php
    session_start();
    $inactive = 600;

you have to write

session_start();

before if(isset($_SESSION['timeout']) ) { ...