@itutoring/itutoring_application_js_api 1.7.11 → 1.7.13

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CookiesManager.js CHANGED
@@ -38,6 +38,11 @@ class CookiesManager
38
38
 
39
39
  return null;
40
40
  }
41
+
42
+ static RemoveCookie(name)
43
+ {
44
+ document.cookie = name + "=; expires=Thu, 01 Jan 1970 00:00:00 UTC; path=/;";
45
+ }
41
46
  }
42
47
 
43
48
  export default CookiesManager;
package/apiController.js CHANGED
@@ -59,8 +59,13 @@ class APIController
59
59
  const urlParams = new URLSearchParams(window.location.search);
60
60
  if (urlParams.has("vid"))
61
61
  {
62
+ if (CookiesManager.GetCookie("session_url") != null)
63
+ CookiesManager.RemoveCookie("session_url");
64
+
62
65
  id = urlParams.get("vid");
63
- CookiesManager.SetCookie("session", id, date.toUTCString(), true);
66
+ const date = new Date();
67
+ date.setTime(date.getTime() + (7 * 24 * 60 * 60 * 1000));
68
+ CookiesManager.SetCookie("session_url", id, date.toUTCString());
64
69
  }
65
70
  else
66
71
  {
@@ -78,6 +83,8 @@ class APIController
78
83
  static GetVisitorSessionID()
79
84
  {
80
85
  //console.log(CookiesManager.GetCookie("session"));
86
+ if (CookiesManager.GetCookie("session_url") != null)
87
+ return CookiesManager.GetCookie("session_url");
81
88
  return CookiesManager.GetCookie("session");
82
89
  }
83
90
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@itutoring/itutoring_application_js_api",
3
- "version": "1.7.11",
3
+ "version": "1.7.13",
4
4
  "description": "Javascript API for iTutoring Application",
5
5
  "main": "index.js",
6
6
  "types": "index.d.ts",