Session Persistence

Overview

Session Persistence allows workflows to maintain application state and user sessions across multiple test steps and workflow executions. This is critical for realistic end-to-end testing where tests need to maintain login sessions or application state throughout the workflow.


Why Session Persistence Matters

Tests execute exactly like real users - maintaining login sessions across multiple pages/actions.


How Session Persistence Works

Session Lifecycle

Workflow Start
  ├── Step 1: Login
  │   └── Session created (cookies, tokens stored)
  ├── Step 2: Navigate to Account
  │   └── Session maintained (credentials available)
  ├── Step 3: Update Profile
  │   └── Session still active (no re-login needed)
  └── Step 4: Logout
      └── Session ended

Without Session Persistence

With Session Persistence


Configuring Session Persistence

Enable Session Persistence

  1. Open workflow

  2. Click "Settings" or "Configuration"

  3. Find "Session Management" section

  4. Toggle "Enable Session Persistence" ON

  5. Configure options (see below)

  6. Save settings

Session Configuration Options


Session Types

Web Application Sessions

For Web-based testing:

Cookies

  • Maintained automatically

  • Browser-based storage

  • Persist across page navigations

Tokens (JWT, OAuth)

  • Automatically captured and reused

  • Headers included in subsequent requests

  • Auto-refresh if supported

Local Storage

  • Application state preservation

  • Cache maintenance

  • Session variables

Mobile Application Sessions

For Mobile testing:

App State

  • Navigation history preserved

  • In-app sessions maintained

  • App state persisted

Authentication

  • Token-based authentication maintained

  • Session cookies for mobile apps

  • Deep link sessions preserved

API Testing Sessions

For API workflows:

Authorization Headers

  • Bearer tokens maintained

  • Session tokens in requests

  • Custom headers preserved

Request/Response State

  • Responses available to subsequent requests

  • Authentication context maintained

  • Error states preserved


Session Data Management

What Gets Persisted?

What Gets Cleared?


Real-World Examples

Example 1: E-Commerce Checkout Flow

Example 2: Multi-Step Form

Example 3: API Workflow


Session Timeout Configuration

Setting Timeout Duration

Timeout Behavior

  1. Inactive for X minutes → Session marked as expired

  2. Next action attempted → Session refresh attempted

  3. If refresh fails → Need to re-authenticate

  4. If refresh succeeds → Workflow continues

Renewing Sessions

Auto-renew sessions:

  1. Enable "Auto-renew on activity"

  2. Each action resets timeout

  3. Long workflows stay active

  4. No manual re-login needed


Cross-Workflow Sessions

Enabling Cross-Workflow Sessions

  1. Open workflow configuration

  2. Check "Share sessions with next workflow"

  3. Or enable at workflow chain level


Security Considerations

✅ Security Best Practices

  • ✅ Use HTTPS for all secure connections

  • ✅ Don't store passwords in session

  • ✅ Use token-based authentication

  • ✅ Set appropriate timeout values

  • ✅ Clear sessions after workflow completes

  • ✅ Use least-privilege test accounts

  • ✅ Encrypt session data in transit

⚠️ Security Risks

  • ⚠️ Session hijacking if not over HTTPS

  • ⚠️ Leaked credentials if stored in logs

  • ⚠️ Unauthorized access if session shared improperly

  • ⚠️ Stale sessions consuming resources

  • ⚠️ Sensitive data in session storage


Troubleshooting Session Issues

Issue: Session expires during workflow

Symptoms:

  • "Session expired" error mid-workflow

  • Need to re-login unexpectedly

  • Workflow fails at random steps

Solutions:

  1. Increase session timeout duration

  2. Enable "Auto-renew on activity"

  3. Reduce workflow execution time

  4. Check network connectivity

  5. Verify no session timeout on server side

Issue: Can't maintain session across steps

Symptoms:

  • Each step requires separate login

  • Cookies not persisted

  • Session disabled after each step

Solutions:

  1. Verify "Session Persistence" is enabled

  2. Check "Clear Between Steps" is OFF

  3. Verify cookies are enabled

  4. Check for cookie restrictions

  5. Review browser/app settings

Issue: Session not shared between workflows

Symptoms:

  • Second workflow doesn't recognize login

  • Session starts fresh each workflow

  • Multiple logins required

Solutions:

  1. Enable "Share sessions with next workflow"

  2. Verify workflows run sequentially

  3. Check timeout between workflows

  4. Verify cross-workflow configuration

Issue: Sensitive data in sessions

Symptoms:

  • Passwords visible in logs

  • Authentication tokens exposed

  • Session data readable

Solutions:

  1. Review session storage settings

  2. Enable sensitive data filtering

  3. Use token-based auth instead of passwords

  4. Check log redaction settings

  5. Encrypt session data


Best Practices

✅ Do

  • Enable session persistence for realistic testing

  • Set appropriate timeout values

  • Use token-based authentication when possible

  • Test login/logout sequences

  • Clear sessions after each workflow run

  • Monitor session performance

  • Document session requirements

  • Use HTTPS for secure sessions

❌ Don't

  • Store passwords in sessions

  • Use default timeout values without testing

  • Share sessions across unrelated workflows

  • Leave long-running sessions active

  • Assume sessions work without testing

  • Log session data with sensitive info

  • Mix session types in same workflow

  • Forget to clean up sessions


Performance Impact

Memory Usage

Session storage uses memory:

  • Simple cookies: ~1-5 KB per session

  • Complex sessions: ~10-50 KB per session

  • Long-running workflows: Maintain for duration

  • Multiple concurrent: Multiply by number of workflows

Optimization Tips

  • Clear sessions between workflows when possible

  • Use appropriate timeout values

  • Don't store unnecessary data

  • Monitor session count and size

  • Cleanup old/expired sessions


Testing Session Persistence

Verification Steps

  1. Login in Step 1

  2. Verify logged-in state in Step 2 (no login required)

  3. Check cookies/tokens persisted

  4. Verify application maintains state

  5. Confirm session expires correctly

Test Scenario


Last updated