Create a temporary user session
This function creates a new temporary user session for a specified service. This allows users with WHM access to log in to third-party applications (for example, billing systems) without storing the account password.
Note:
- The system destroys the temporary session after 15 minutes of inactivity.
- For more information about the Single Sign On feature, read our Guide to API Authentication documentation.
Query parameters
The session's service.
The session's cPanel account username or a valid email address.
The cPanel or WHM application to which the session will link. This parameter defaults to a blank string, which redirects the user to the cPanel Home interface.
- A valid application name, to link the session to an application.
- An invalid application name, to create the session but not link it to an application.
The session's security token.
The session's locale. This parameter defaults to the Server Locale setting in WHM's Tweak Settings interface (WHM >> Home >> Server Configuration >> Tweak Settings).
Note:
- If you specify a locale, the server sends a cookie to your browser with that locale setting. The cookie expires after one year.
- Users can change the locale with the language options at the bottom of the login interface.
The hostname or IP address for the function to use in the url return. This parameter's value defaults to the server's hostname.
The prompt token to pre-populate the user's website-generation goals when logging into the Nova interface.
Note:
- This value must be base64-encoded.
- Maximum decoded length is 5000 characters.
Response
HTTP Request was successful.
Example response
{
"data": {
"cp_security_token": "/cpsess1234567890",
"expires": 1401993893,
"service": "cpaneld",
"session": "username:RFw6MUp9S8sRwTSgqaUJWUCq8ZQg2Zkopx5KaTHRNQXBfT3n8xvfBEF9JJC3iiwa",
"url": "https://example.com:2083/cpsess1234567890/login/?session=username:RFw6MUp9S8sRwTSgqaUJWUCq8ZQg2Zkopx5KaTHRNQXBfT3n8xvfBEF9JJC3iiwa&locale=fr"
},
"metadata": {
"command": "create_user_session",
"reason": "Created session",
"result": 1,
"version": 1
}
}