none
PHP $_SESSION variables are getting replaced while a new user logs in to Azure App Service (Free:Plan) RRS feed

  • Question

  • In azure app service I am authenticating users using office365, once user logs in I am storing some data in $_SESSION variables. But the problem occurs when multiple users log in to the application.

    For Example: User "A" has logged in to the application and I am storing user-data $_SESSION["username"] = "A" and redirecting to a page, and at the same time User "X" is logging into the application and the user-data $_SESSION["username"] = "X" is replacing the previous $_SESSION["username"] value i.e "A".

    1. In the php.ini session.save_handler => files; session.save_path => /home/site/wwwroot/tmp

    2. This application is hosted as Azure App Service[Linux] with Free ASP.

    3. And I am using PHP Version 7.2.20.
    <?php
    session_start();
    //Codes to authenticate user and getting user details
    $_SESSION["username"] = "John";
    session_write_close();
    header("Location: page1.php");
    ?>

    here once a user named "Doe" is logging in. The Value in $_SESSION["username"] is getting replaced by "Doe";

    Friday, September 13, 2019 8:03 AM

All replies

  • Hi Suresh,

    Which frame are you using? 

    Friday, September 13, 2019 5:28 PM
    Moderator
  • I am using PHP Zend Framework. And the version in 7.2.20
    Monday, September 16, 2019 6:41 AM
  • I tried to reproduce this issue, but it worked for me.

    Could you please send an email to AzCommunity[at]Microsoft[dot]com referencing this thread, we would like to work closer with you on this matter

    Friday, September 20, 2019 4:36 PM
    Moderator