AZURE PHP web app session variables

Ruan De Beer 0 Reputation points
2023-02-13T07:41:04.9666667+00:00

How does session variables work in Azure. I ported a PHP app from another hosting environment that worked fine. I have a login page that verifies user credentials and pass control to the home page. On the home page my session variables that was set in the authentication process is now empty. My session variable path shows an old path from my previous hosting environment. I tried changing this in the php ini file with no success. I tried creating a new ini file in the www root directory and also changed the ini file in the home site ini directory. None seems to set the path correctly and it remains set to the old path which i am convinced is not correct. var/cpanel/php/sessions/ea-php74 - Is there another way to overwrite this session variable path or another way to use session variables in Azure?

Azure App Service
Azure App Service
Azure App Service is a service used to create and deploy scalable, mission-critical web apps.
8,933 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Grmacjon-MSFT 19,151 Reputation points Moderator
    2023-03-17T20:33:57.02+00:00

    Hi @Ruan De Beer sorry to hear you are facing this issue. when you created the new ini file, did you restart the app for the change to take effect? are you getting an error messages?

    keep in mind that in Azure App Service, you can customize PHP_INI_SYSTEM directives using the PHP_INI_SCAN_DIR app setting. You can add an app setting called PHP_INI_SCAN_DIR by running the following command in the Cloud Shell:

    az webapp config appsettings set --name <app-name> --resource-group <resource-group-name> --settings PHP_INI_SCAN_DIR="/usr/local/etc/php/conf.d:/home/site/ini"
    
    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.