Cookies
A 'cookie' refers to a small text file that is stored on your computer by the web browser while you're browsing a website. However, in this documentation, when we refer to 'cookies', we're also including other similar technologies and tools that collect and store information in your browser. In some cases, these technologies might forward such information to third parties in a manner akin to cookies. Examples of these technologies include pixels, local storage, session storage, and fingerprinting.
Manifest
App developers can define which storage values their app uses in the manifest.
Each value is defined by adding a key in the storage
object.
If an app attempts to set any value that has not been defined in the app manifest, the operation will be stopped.
{
"$schema": "https://unpkg.com/@telia-ace/alliance-framework/dist/manifest.schema.json",
"storage": {
"xyz-user-interaction-tracker": {
"category": "analytics",
"lifespan": "Until user closes the browser.",
"purpose": "This value is used by framework 'XYZ' to track user interactions to improve our app."
}
}
}
The key for each value under storage
should correspond with the key used when writing the cookie.
The example above allows my app to set a cookie using the key xyz-user-interaction-tracker
.
Each cookie must have three different properties defined.
- Category
The allowed categories arenecessary
,functional
,analytics
ormarketing
, - Lifespan
Local storage can only be cleared by the user while session storage is cleared when the page is closed. - Purpose
How to categorize cookies
Below are some examples to help you figure out which category your cookie falls into.
Necessary
Essential for your app's fundamental operations and cannot be disabled. They are typically set in response to actions made by the user which amount to a request for services, such as logging in, setting privacy preferences or filling in forms.
Examples of when to categorize a cookie using "necessary":
- It's needed to maintain a logged-in status or to identify a user's session.
- It's used to ensure the security of user data and the platform, such as detecting repeated failed login attempts.
- It's used to remember the state of a user's current operations, such as items in a shopping cart or the user's progress in a multi-step process.
Functional
Enhances the user experience by remembering information that changes the way the website behaves or looks, such as the user's preferred language or the region they are in.
Examples of when to categorize a cookie using "functional":
- It remembers user preferences to provide personalized features.
- It's used to store settings like layout, theme, or other visual preferences.
- It remembers information that changes how certain features behave (for example, disabling a tutorial for returning users).
Analytics
Helps the app owner understand how visitors interact with their app by collecting and reporting information anonymously.
Examples of when to categorize a cookie using "analytics":
- It's used to collect information about how users interact with your app, such as page views, user paths, session duration, and click tracking.
- It's used to monitor performance metrics like loading times or error messages.
Marketing
Used to track users across websites and apps. The intention is to display ads that are relevant and engaging for the individual user.
Examples of when to categorize a cookie using "marketing":
- It's used to create a profile of user interests to show relevant and personalized ads.
- It's used to track the effectiveness of advertising campaigns.
- It's used to track users across multiple websites or platforms.