const TokenKey = 'token'

const DeviceID = 'deviceId'

export function getToken() {
  return sessionStorage.getItem(TokenKey);
}

export function getDeviceId() {
  return sessionStorage.getItem(DeviceID);
}

export function setToken(token) {
  return sessionStorage.setItem(TokenKey, token);
}

export function removeToken() {
  return sessionStorage.clear();
}

export function removeCookie () {
  var date = new Date();
  date.setTime(date.getTime() + 24*60*60*1000*-1);
  window.document.cookie = "JSESSIONID=;path=/;expires="+date.toGMTString();
}
