parent
f65402204e
commit
a2f03869d1
@ -0,0 +1,3 @@
|
||||
<?php
|
||||
|
||||
echo 'web';
|
@ -0,0 +1,19 @@
|
||||
<?php
|
||||
|
||||
# check session cookie
|
||||
$cookie = null;
|
||||
$valid_cookie = false;
|
||||
if (isset($_COOKIE['rf_sess'])) {
|
||||
$cookie = trim($_COOKIE['rf_sess']);
|
||||
if (preg_match('/^[a-z0-9]+$/', $cookie)) {
|
||||
require_once '/src/classes/database.php';
|
||||
$sm = $db->prepare('SELECT id FROM oauth_tokens WHERE cookie = ?');
|
||||
$sm->execute([$cookie]);
|
||||
if (($oauth = $sm->fetch()) !== false) {
|
||||
if (isset($oauth['id']))
|
||||
$valid_cookie = true;
|
||||
}
|
||||
}
|
||||
if (!$valid_cookie)
|
||||
setcookie('rf_sess', null);
|
||||
}
|
Loading…
Reference in new issue