Cookies
Save2ERP only uses technical cookies, required for it to work: no tracking, no audience measurement. The sign-in token for the target system is encrypted in a cookie and can never be read by the browser.
List of cookies
| Cookie | Content | Duration | Purpose |
|---|---|---|---|
__Host-SWC_WordAddIn_Token | Encrypted OAuth2 token | OAUTH_COOKIE_MAXAGE (7 days by default) | User's session on the target system. |
__Host-SWC_WordAddIn_System | Target system of the session | OAUTH_COOKIE_MAXAGE | Prevents changing system during a session. |
__Host-SWC_WordAddIn_OAuthPKCE | Temporary sign-in values (state and code_verifier) | 5 minutes | Protects the OAuth2 sign-in round trip. |
__Host-SWC_WordAddIn_LicenseCheck | License ID, user fingerprint, date of the check | 24 hours | Avoids repeating the license check each time the pane opens. |
Properties
All cookies are:
- signed: a modified cookie, or one signed with an old
OAUTH_COOKIE_SIGN_KEY, is ignored, and the user is asked to sign in again; httpOnly: not accessible to page scripts;SecureandSameSite=None: sent over HTTPS only, including inside the Word on the web frame;- prefixed with
__Host-: the browser binds them to the server's exact host name, without a parent domain. Another application on a neighboring subdomain cannot replace them.
Word on the web
In Word on the web, the pane is shown in a frame of the Office page: its cookies are third-party cookies. Word for Windows and Mac are not affected.
| Browser | Situation |
|---|---|
| Chrome, Edge | Works with the default settings. Blocked in private browsing, if the user blocks third-party cookies, or by a company policy (BlockThirdPartyCookies). |
| Safari | Not supported: third-party cookies blocked by default. |
| Firefox | Not supported: third-party cookies isolated by default. |
If cookies are blocked, the pane shows the "Cookies blocked" error (COOKIES_BLOCKED).
Two servers on the same host name
A browser shares the cookies of a host name across all its ports: two Save2ERP servers on the same host name would overwrite each other's sessions. The simplest is to give each one its own host name (e.g. save2erp.my-company.com and save2erp-test.my-company.com). Otherwise, the COOKIE_PREFIX variable adds a different prefix to the cookie names of each server, for example __Host-Test_SWC_WordAddIn_Token.
Changing COOKIE_PREFIX or OAUTH_COOKIE_SIGN_KEY ends all sessions: each user must sign in again.