Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sessions #16

Merged
merged 3 commits into from
Oct 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -78,10 +78,10 @@ Hellotext.removeEventListener(eventName, callback)

## Understanding Sessions

The library looks for a session identifier present on the `hellotext_session` query parameter. If the session is not present as a cookie neither it will create a new random session identifier, you can disable this default behaviour via the configuration, see [Configuration Options](#configuration-options) for more information.
The library looks for a session identifier present on the `hello_session` query parameter. If the session is not present as a cookie neither it will create a new random session identifier, you can disable this default behaviour via the configuration, see [Configuration Options](#configuration-options) for more information.
The session is automatically sent to Hellotext any time the `Hellotext.track` method is called.

Short links redirections attaches a session identifier to the destination url as `hellotext_session` query parameter. This will identify all the events back to the customer who opened the link.
Short links redirections attaches a session identifier to the destination url as `hello_session` query parameter. This will identify all the events back to the customer who opened the link.

### Get session

Expand Down
2 changes: 1 addition & 1 deletion dist/hellotext.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion lib/models/cookies.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ var Cookies = /*#__PURE__*/function () {
key: "set",
value: function set(name, value) {
if (typeof document !== 'undefined') {
document.cookie = "".concat(name, "=").concat(value);
document.cookie = "".concat(name, "=").concat(value, "; path=/;");
}
_hellotext.default.eventEmitter.dispatch('session-set', value);
return value;
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@hellotext/hellotext",
"version": "1.8.0",
"version": "1.8.1",
"description": "Hellotext JavaScript Client",
"source": "src/index.js",
"main": "lib/index.js",
Expand Down
2 changes: 1 addition & 1 deletion src/models/cookies.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import Hellotext from '../hellotext'
class Cookies {
static set(name, value) {
if(typeof document !== 'undefined') {
document.cookie = `${name}=${value}`
document.cookie = `${name}=${value}; path=/;`
}

Hellotext.eventEmitter.dispatch('session-set', value)
Expand Down
Loading