#!/bin/bash

echo "Content-Type:text/html;charset=utf-8"
echo ""

# 尝试获取该会话ID的用户信息
username=$(redis-cli -c -h 10.10.10.27  GET $HTTP_COOKIE)
# 如果获取到，注销登录返回登录页面
if [ -n "$username" ]; then
  redis-cli -c -h 10.10.10.27  DEL $HTTP_COOKIE
  echo "注销成功"
  echo "<meta http-equiv="refresh" content="3\;URL=/login.html">3秒内返回登录页面</meta>"
  exit
fi
