<?php
session_start();
if (!isset($_SESSION["user_id"])) {
    header("Location: ChatLogin");
    exit();
} else {
    if (isset($_COOKIE["rememberme"])) {
        $_SESSION["user_id"] = $_COOKIE["rememberme"];
        header("Location: ChatMessage");
        exit();
    } else {
        header("Location: ChatMessage");
        exit();
    }
}
?>