Saturn
Saturn 1.0.0
Saturn 1.0.0
  • Saturn 1.0.0
  • 😁User Guide
    • Settings
      • Maintenance Mode
      • Website Environment
    • Security
      • Good security practices
      • Security Notice
    • System Requirements and Support
    • Update your Server
  • ⚠️Troubleshooting
    • Errors
      • Database Errors
      • Saturn Errors
      • Checksum Issues
  • 🧩Plugins
    • Plugins in Saturn
    • Official Plugins
      • Control Panel
        • User Guide
        • Developer Guide
          • Control Panel Hooks
    • Marketplace Plugins
  • 💻Developer Documentation
    • Getting Started
    • Libraries and Functions
      • AccountManager
        • Permissions
        • UUID
      • DatabaseManager
        • DBMS
          • Sending Database Requests
          • Query Information
          • Database Security
        • Database Actions
      • HookManager
        • Actions
        • Runners
      • HTTP
      • LanguageManager
      • PluginManager
        • Manage Plugin Content
        • Plugin Compatability
        • Check if a plugin is loaded.
        • Fetch Manifest
      • RouteManager
      • SecurityManager
        • Cross-site Request Forgery
        • Cross-site Scripting
      • SessionManager
        • Start and End Sessions
        • Validate Sessions
        • Session Data
      • TestManager
    • Security
    • Plugins
      • How to structure a plugin
      • Manifest
      • APIs
      • Checking for Dependencies
      • Power Features
        • 💤Hibernate
    • Hooks
    • Tests and Profiling
    • Global Variables
Powered by GitBook
On this page
  • Validate Sessions
  • Generate User Sessions
  • Accessing session data
  1. Developer Documentation
  2. Libraries and Functions
  3. SessionManager

Validate Sessions

Validate Sessions

You can check that users are genuine by validating sessions.

use Saturn\SessionManager\Authenticate;

$Authenticate = new Authenticate();

if ($Authenticate->Validate()) {
    // Valid session
} else {
    // Invalid session
}

Generate User Sessions

This function can be used to securely generate session tokens and store the user's username and UUID in session variables.

This does not check their credentials against the database, you MUST use the database system to do this.

use Saturn\SessionManager\Authenticate;

$Authenticate = new Authenticate();
$Authenticate->Generate($Username, $UUID)

Accessing session data

Sesssion data can be accessed like any usual session.

$Username = $_SESSION['Username'];
$UUID = $_SESSION['UUID'];
$Token = $_SESSION['Token'];
PreviousStart and End SessionsNextSession Data

Last updated 1 year ago

💻