Location: PHPKode > projects > WH Community > wh_community/framework/session.php
<?php

    ini_set('session.use_trans_sid', 0);
    ini_set('session.use_cookies', 1);

    ini_set('session.use_only_cookies', 'on');
    ini_set('session.use_only_cookies', 1);

    session_cache_expire(180);
    session_cache_limiter(60);

    session_start();

    require('framework/constants.php');
    require('framework/error.php');

        require('framework/config.php');
        require('framework/mysql.php');
        require('framework/language.php');

            include_once('functions/counter.php');
            include_once('framework/cache.php'); no_cache();
            include_once('framework/protection.php');


    if(isset($_SESSION['signed_in'])) {

            if(!isset($_SESSION['signed_in'])) {

                session_regenerate_id();
                $_SESSION['signed_in'] = TRUE;
                }

            if(isset($_SESSION['REMOTE_ADDR'])) {

                if($_SESSION['REMOTE_ADDR'] != $_SERVER['REMOTE_ADDR']) {
                exit;
                }

            }else{

            $_SESSION['REMOTE_ADDR'] = $_SERVER['REMOTE_ADDR'];
            }

            if(isset($_SESSION['HTTP_USER_AGENT'])) {

                if($_SESSION['HTTP_USER_AGENT'] != sha1($_SERVER['HTTP_USER_AGENT'])) {
                exit;
                }

        }else{

        $_SESSION['HTTP_USER_AGENT'] = sha1($_SERVER['HTTP_USER_AGENT']);
        }
    }


    function close_connection() {
        if($_SESSION['signed_in'] == TRUE) {

            $_SESSION['signed_in'] = NULL;
            $_SESSION = array();
            }
        
        session_destroy();
        
        if(!isset($connect))
        return;

        mysql_close($connect);
        }

?>
Return current item: WH Community