我正在使用React应用程序,正在使用redux-react-session来存储我的用户会话,并使用redux-persist保持我的redux状态,以便我可以处理仪表板和登录页面。在普通窗口,隐身窗口和隐身窗口的新标签页中,Chrome都可以正常运行。
但是问题出现在Firefox中。当我登录隐身窗口并使用相同的URL打开新的隐身标签时,用户将注销。我找不到与此有关的任何解决方案。对于如何仅在客户端上处理用户会话的帮助将深表感谢。该问题仅在隐身模式(Firefox)中出现
这是我的redux存储设置
import history from '@/routes/History';
import { routerMiddleware } from 'connected-react-router';
import { applyMiddleware, compose, createStore } from 'redux';
import { sessionService } from 'redux-react-session';
import createSagaMiddleware from 'redux-saga';
import thunkMiddleware from 'redux-thunk';
import { persistStore, persistReducer } from 'redux-persist';
import storage from 'redux-persist/lib/storage';
import rootReducer from './root-reducer';
import sagas from './root-saga';
const sagaMiddleware = createSagaMiddleware();
const middlewares = [sagaMiddleware, thunkMiddleware, routerMiddleware(history)];
const persistConfig = {
key: 'root',
storage,
blacklist: ['delegateMeetingReducer', 'loaderReducer'],
};
const composeEnhancers = window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__ || compose;
const persistedReducer = persistReducer(persistConfig, rootReducer(history));
const store = createStore(persistedReducer, composeEnhancers(applyMiddleware(...middlewares)));
const persistor = persistStore(store);
const validateSession = () => true;
const options = {
refreshOnCheckAuth: false,
redirectPath: '/',
driver: 'LOCALSTORAGE',
validateSession,
};
sagaMiddleware.run(sagas);
sessionService.initSessionService(store, options);
sessionService.refreshFromLocalStorage();
export { store, persistor };