Managing Session ID with Server Side Rendering | Community
Skip to main content
Level 2
January 17, 2023
Solved

Managing Session ID with Server Side Rendering

  • January 17, 2023
  • 1 reply
  • 2776 views

My team is implementing server side rendered AB tests using Adobe Target, and are curious about the best practices surrounding Session IDs. The application we are building uses Angular and Adobe Launch to integrate w/ Target and Analytics. How do we ensure that the server can detect 30 minutes of inactivity and recreate a new session ID for users?

 

The Adobe Target Cookies page states that:

  • For a particular session, its value must stay the same across multiple requests
  • The session is active for 30 minutes on the server side. Therefore, you shouldn’t use a different Session Id for a particular tntId/thirdPartyId within 30 minutes of the last request made with the tntId/thirdPartyId. Otherwise, changes to the profile could be inconsistent and unpredictable.
  • A new Session ID must be used after thirty minutes of inactivity from a visitor.

 

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by ryanr7

Hi @seeplusplus,

What method of implementation are you using on the server-side? Are you using one of our SDK's or are you using the Delivery API to implement?

If you are using one of the server-side SDK's that SDK should manage session id generation and persistence for you. Just install the SDK, initialize it and use the methods available in the SDK. If you are using the Delivery API, then you'll need to create some code to generate a session id and maintain it for a current session. The Target server doesn't generate the session id this is something the client making calls to the Targe server should do.

In this case, you'll want to follow the guidelines on the help doc for the Delivery API under Retrieve Target Offers > Query Parameters > sessionId.

Hope that helps!

-R

1 reply

ryanr7Adobe EmployeeAccepted solution
Adobe Employee
January 17, 2023

Hi @seeplusplus,

What method of implementation are you using on the server-side? Are you using one of our SDK's or are you using the Delivery API to implement?

If you are using one of the server-side SDK's that SDK should manage session id generation and persistence for you. Just install the SDK, initialize it and use the methods available in the SDK. If you are using the Delivery API, then you'll need to create some code to generate a session id and maintain it for a current session. The Target server doesn't generate the session id this is something the client making calls to the Targe server should do.

In this case, you'll want to follow the guidelines on the help doc for the Delivery API under Retrieve Target Offers > Query Parameters > sessionId.

Hope that helps!

-R

Level 2
January 17, 2023

Thanks @ryanr7 ! We're trying to use the Adobe Target NodeJS SDK.

 

One of the challenges I've been working on is keeping things coherent between test assignments received by the Target NodeJS SDK and our analytics calls from our front end application. We currently use look at reports in Analytics that visualize events and engagement grouped by which experience they were in. Does the server side session ID need to match the client side session ID for this to work?

Level 4
January 18, 2023

Part of the Target response/API response you will have SDID or tnta 
You have to pass SDID (web)/tnta (mobile app) parameter via analytics call 
This will make a4t (Analytics for Target) works and join your Analytics data with Target Data

 

PS: Easy way to maintain 30min session id would be keeping the value in a cookie  with 30min expiry; If cookie is not present generate a new one; Don't use random to generate new session id every time; This will have other impact.