Skip to content

problem with session_start PHP 8.1.27 #13385

@kewingJ

Description

@kewingJ

Description

The following code:

index.php
<?php
    session_start();
    $_SESSION['user'] = 'juan';
    $_SESSION['status'] = true;
    header("location: home.php");
    exit();
?>

home.php
<?php
    session_start();
    $user = $_SESSION['user'];
    echo $user;
?>

In my home.php view no data is shown and in my session folder the sessions are duplicated for each call to the session_start() method.

Resulted in this output:
Captura1

I am using the latest version of php 8.1 which is php 8.1.27 and Nginx server 1.14 and 1.24. Operating system debian 12

PHP Version

PHP 8.1.27

Operating System

debian 12

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions