Advertisement
kangjaz

timer_login

Sep 9th, 2017
1,230
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.37 KB | None | 0 0
  1. <?php
  2. //function timer login
  3. function timer()
  4. {
  5.    $timeout = 30; // dalam satuan detik
  6.    $_SESSION['timeout'] = $timeout;
  7. }
  8.  
  9. function cek_login() {
  10.    if (isset($_SESSION['timeout']))
  11.    {
  12.       $exp_time = $_SESSION['timeout'];
  13.  
  14.       if (time() < $exp_time) {
  15.          timer();
  16.          return true;
  17.       } else {
  18.          return false;
  19.       }
  20.    }
  21. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement