Overview
RDSWeb Custom offers two session modes that control how long users remain authenticated and how long their RemoteApp sessions stay active. The mode is selected during login and affects both the web session (JWT token) and the RDP session timeout.Session Mode Types
Private Mode
Recommended for: Personal devices, trusted computers, home office- Web session timeout: 240 minutes (4 hours)
- RDP session timeout: 240 minutes (4 hours)
- Use case: Users working from their personal laptop or home workstation
- Security assumption: Device is physically secure and not shared
Public Mode
Recommended for: Shared computers, public kiosks, hotel business centers- Web session timeout: 20 minutes
- RDP session timeout: 20 minutes
- Use case: Users accessing from shared or untrusted devices
- Security assumption: Device may be accessed by others after user leaves
How Session Modes Work
Login Flow
Users select their session mode during login:Backend Implementation
JWT Token Generation
The session mode is embedded in the JWT token:Timeout Calculation
| Mode | Minutes | Cookie maxAge | RDP Timeout |
|---|---|---|---|
| Private | 240 | 14,400,000 ms | 14,400 sec |
| Public | 20 | 1,200,000 ms | 1,200 sec |
RDP File Generation
The session mode affects the generated RDP file:- Private mode (240 min): User can work for 4 hours without interruption
- Public mode (20 min): Session disconnects after 20 minutes of total session time
Session Mode Detection
The current session mode is available throughout the application:Backend (from JWT)
Frontend (from /auth/me)
User Experience Considerations
Private Mode Experience
Advantages:- Fewer interruptions during long work sessions
- Don’t need to re-login frequently
- Better for tasks requiring sustained focus
- Higher security risk if device is stolen or accessed
- Token remains valid for 4 hours even if user walks away
- Home office workers
- Employees with dedicated workstations
- Development and testing environments
Public Mode Experience
Advantages:- Reduced security risk on shared devices
- Forces users to re-authenticate frequently
- Minimizes exposure if user forgets to log out
- Frequent re-authentication required
- Disrupts long-running tasks
- May frustrate users for legitimate extended work
- Shared kiosks in office lobbies
- Public computers (libraries, business centers)
- High-security environments
- Temporary or guest access
Security Implications
Token Lifetime vs. Cookie Lifetime
Two separate timeouts are at play:-
JWT Token Expiration (
expiresIn: '8h')- Maximum token lifetime regardless of mode
- Prevents tokens from being valid indefinitely
- Set in
JWT_EXPIRES_INenvironment variable
-
Cookie maxAge (20 or 240 minutes)
- Browser automatically deletes cookie after timeout
- Forces re-login even if JWT hasn’t expired
- Shorter timeout provides better security
- Private mode: Cookie expires after 4 hours, user must re-login
- Public mode: Cookie expires after 20 minutes, user must re-login
- In both cases, even if cookie remained, JWT would expire after 8 hours
RDP Session Timeout
The RDP session timeout is independent of the web session:- RDP client receives disconnect notification
- Application saves state (if supported)
- Session is disconnected (not logged off)
- User can reconnect to resume session (if server allows)
Idle vs. Session Timeout
Session timeout (what RDSWeb Custom sets):- Total time since session start
- Disconnects after X minutes regardless of activity
- Cannot be extended without reconnecting
- Time since last user input
- Can be configured separately in Windows Server
- Resets on any keyboard/mouse activity
Mode Selection UI
Typical login form with mode selection:Configuration
Session timeouts are hardcoded but can be customized:Compliance Considerations
PCI DSS
Payment Card Industry Data Security Standard requires:- Maximum 15 minutes of inactivity timeout
- Re-authentication after idle period
HIPAA
Health Insurance Portability and Accountability Act recommends:- Automatic logoff after period of inactivity
- Shorter timeouts for unattended workstations
SOC 2
Service Organization Control 2 requires:- Session timeouts appropriate to risk level
- Re-authentication for sensitive operations
Monitoring and Analytics
Track session mode usage:- Percentage of users choosing each mode
- Average session duration by mode
- Timeout-related disconnections
- Re-login frequency
Troubleshooting
Sessions Expiring Too Quickly
Check:- Cookie
maxAgeis set correctly:timeoutMinutes * 60 * 1000 - JWT
expiresInis not shorter than intended timeout - Server clock is synchronized (JWT uses timestamps)
- Browser is not clearing cookies prematurely
Sessions Not Expiring
Check:- Cookie
maxAgeis being set (notundefined) - JWT expiration is enabled:
jwt.sign(payload, secret, { expiresIn: '8h' }) - Backend is validating token expiration:
jwt.verify(token, secret)
RDP Sessions Disconnect Prematurely
Check:- RDP file contains correct timeout:
session timeout:i:14400 - Server group policy doesn’t override with shorter timeout
- Network isn’t dropping idle connections
- RD Gateway timeout settings
Best Practices
- Default to public mode for security
- Educate users on when to use each mode
- Monitor mode selection patterns
- Align RDP timeout with web session timeout
- Implement server-side idle detection for compliance
- Test both modes regularly
- Document organizational policy on mode selection
Next Steps
- Learn about Authentication and JWT security
- Understand RDP Generation timeout configuration
- Explore the RemoteApp Catalog system