Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Functional Error: Session Management Issues #29

Copy link
Copy link

Description

@codeCraft-Ritik
Issue body actions

Description:

In login.inc.php, the code attempts to set session variables, but session_start() is commented out within the success block. Furthermore, application_form.php relies on $_SESSION['roll'] and $_SESSION['fname'], but if a user accesses this page directly without logging in, the script will trigger "Undefined index" errors and potentially crash.

Recommended Fix:

Ensure session_start() is called at the very top of every protected page and implement an authentication check.

Code Implementation (top of application_form.php):

<?php
  require 'includes/config.inc.php'; // config.inc.php already has session_start()
  
  // Add authentication check
  if (!isset($_SESSION['roll'])) {
      header("Location: index.php?error=notloggedin");
      exit();
  }
?>
Reactions are currently unavailable

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

    Morty Proxy This is a proxified and sanitized view of the page, visit original site.