summaryrefslogtreecommitdiff
path: root/authentication.php
blob: 882650f4b21310de1dbc309e73103aa4aca1584e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17

<?php // 验证登录 

    require_once 'config.php' ;

    $token = $_POST['token'];

    if($token == Config::$admin_token){
        session_start();
        $_SESSION['admin'] = true;
        setcookie(session_name(), session_id(), time() + $lifeTime);
        header('Location: '.'admin.php');
    } else {
        die("Wrong token.");
    }

?>