controller/js/my-gallery.js
//********************* after login first of all we store session token in localstorage **************************//
after login first of all we store session token in localstorage
after login first of all we store session token in localstorage
function session_token() {
  const session_token = $("#session_token").val();
  if (localStorage.getItem("SmartGallery") == null) {
    try {
      var SmartGallery = [];
      SmartGallery.push(["session_token", session_token]);
      var localStore = localStorage.setItem(
        "SmartGallery",
        JSON.stringify(SmartGallery)
      );
      console.log(localStorage.getItem("SmartGallery"));
    } catch (err) {
      alert(err.message);
    }
  } else {
    try {
      let getItem = localStorage.getItem("SmartGallery");
      let parse = JSON.parse(getItem);
      parse.push(["session_token", session_token]);
      var localStore = localStorage.setItem(
        "SmartGallery",
        JSON.stringify(parse)
      );
      console.log(localStorage.getItem("SmartGallery"));
    } catch (err) {
      alert(err.message);
    }
  }
}
function session_token ( ) { const session_token = $ ( "#session_token" ) . val ( ) ; if ( localStorage . getItem ( "SmartGallery" ) == null ) { try { var SmartGallery = [ ] ; SmartGallery . push ( [ "session_token" , session_token ] ) ; var localStore = localStorage . setItem ( "SmartGallery" , JSON . stringify ( SmartGallery ) ) ; console . log ( localStorage . getItem ( "SmartGallery" ) ) ; } catch ( err ) { alert ( err . message ) ; } } else { try { let getItem = localStorage . getItem ( "SmartGallery" ) ; let parse = JSON . parse ( getItem ) ; parse . push ( [ "session_token" , session_token ] ) ; var localStore = localStorage . setItem ( "SmartGallery" , JSON . stringify ( parse ) ) ; console . log ( localStorage . getItem ( "SmartGallery" ) ) ; } catch ( err ) { alert ( err . message ) ; } } }
after login first of all we store session token in localstorage
after login first of all we store session token in localstorage