I have built this reactjs app the get cookie function wont work with Iphones and it return blank page it works fine with android and computers but not in iphones
here is the javascript code for getting the cookie and also let me remind that I am using react redux ass well
the code is in store.js
function getCookie(name) {
const value = `; ${document.cookie}`;
const parts = value.split(`; ${name}=`);
if (parts.length === 2) return parts.pop().split(";").shift();
}
const userInfoFromStorage = getCookie("userInfo")
? JSON.parse(getCookie("userInfo"))
: null;
const initialState = {
userLogin: {
userInfo: userInfoFromStorage,
},
};
const middleware = [thunk];
const store = createStore(
reducer,
initialState,
composeWithDevTools(applyMiddleware(...middleware))
);
export default store;
please help me :)