<?php

namespace App\Controllers;

class TestSession extends BaseController
{
    public function index()
    {
        echo "<h1>Session Test</h1>";
        echo "<pre>";
        echo "Session ID: " . session_id() . "\n\n";
        echo "Session Data:\n";
        print_r(session()->get());
        echo "\n\nLogged In: " . (session()->get('logged_in') ? 'YES' : 'NO') . "\n";
        echo "User ID: " . (session()->get('user_id') ?? 'NOT SET') . "\n";
        echo "Role: " . (session()->get('role') ?? 'NOT SET') . "\n";
        echo "</pre>";
        
        echo "<hr>";
        echo "<a href='/dashboard'>Go to Dashboard</a><br>";
        echo "<a href='/login'>Go to Login</a><br>";
        echo "<a href='/auth/logout'>Logout</a>";
    }
}
