Updated on 2023-06-25 GMT+08:00

Configuring Distributed Sessions

Traditional single-instance applications use local session management. Session contexts generated by user requests are stored in the process memory. After the load balancing module is added, multi-instance sessions need to be shared using distributed storage.

ServiceStage provides the out-of-the-box distributed session function. It uses the Distributed Cache Service as the session persistence layer. Without code modification, ServiceStage supports distributed session management for Tomcat applications, Node.js applications that use express-session, and PHP applications that use session handle.

During Deploying a Component, you can bind distributed sessions in Database.

Prerequisites

Before setting a distributed session, create a distributed session. For details, see Creating a DCS Redis Instance.

Procedure

  1. During component deployment, select Distributed session on the Configure Component page.
  2. Click Add One. On the Edit Environment page that is displayed, click Add Optional Resource to add created DCS resources to the environment.