Cross-domain session support
Javascript for sessions across multiple domains or sub-domains.
Cross-domain sessions
In some cases, several of your domains or sub-domains need to be visited in a single session.
To enable this, add the following javascript snippet within our web SDK to all required pages.
CobrowseIO.trustedOrigins = [
'https://www.myexample.com', // origin to trust
'https://my-other-website.net', // another origin to trust
'https://intranet.myexample.com:8443' // an origin with a port to trust
];
CobrowseIO.start(); // before the start callThis provides Cobrowse for Web with a list of trusted origins to allow your session to continue on. All trusted origins must be listed.
Example code: https://github.com/cobrowseio/cobrowse-sdk-js-examples#cross-domain-sessions.
Sub-domains
If your sessions are across sub-domains of the same subdomain we recommend adding the top-level domain and any required subdomains. Glob matching is also supported here.
CobrowseIO.trustedOrigins = [
'https://myexample.com', // top-level domain
'https://*.myexample.com' // glob-matching can be used to match all domains
'https://login.myexample.com', // or specific sub-domains can also be specified
'https://support.myexample.com'
];
CobrowseIO.start(); // before the start callWhen the top-level domain is configured as a trusted origin Cobrowse will use cookies support session continuation across sub-domains of that top-level domain.
Supported browsers
Google Chrome
Mozilla Firefox
Safari
Cross-domain support will fail in a browser's private or "incognito" mode.
Last updated