$ SESSIOn with durability

0

Hello, how can I complement the code below to work as I need the section to be destroyed once a day if the user creates SESSION on 08/18/2015 if he sees the same page with that SESSION on day 02/08/2015 forward it is destroyed only keeping the section valid if its date is the same. I need to keep $ SESSION ['username_name'] and $ _ SESSION ['userIp'] .

     <?php
    session_start();
    $_SESSION['nomeSecao'] = $secaoNome;
    $_SESSION['usuarioIp'] = $_SERVER["REMOTE_ADDR"]; 


    if(isset($_SESSION['usuario'], $_SESSION['usuarioIp'] ))
    {

// Da Insert + 1 na tabela secao coluna view

    }

    ?>
    
asked by anonymous 30.07.2015 / 19:31

1 answer

1

Complementing Gerep's response:

<?php
if (isset($_COOKIE['data_acesso'])) {
    echo 'Você JÁ passou por aqui!';
} else {
    echo 'Você NUNCA passou por aqui.';
    setcookie('data_acesso', date('Y-m-d 00:00:00'), time() + 86400);
}
    
30.07.2015 / 19:58