How to access it the persistence variable in authentication on firebase v9 react.js?

setPersistence(auth, browserSessionPersistence)
.then(() => {
createUserWithEmailAndPassword(auth, email, password)
.then((userCredential) => {
setUser(userCredential.user.email.split(“@”)[0]);
})
.catch((error) => {
setError(error.message);
});
})
.catch((error) => {
setError(error.message);
});

// This is my code I’m using the setPersistence function what does it do? and how to access it?

setPersistence(auth, browserSessionPersistence)
.then(() => {
createUserWithEmailAndPassword(auth, email, password)
.then((userCredential) => {
setUser(userCredential.user.email.split(“@”)[0]);
})
.catch((error) => {
setError(error.message);
});
})
.catch((error) => {
setError(error.message);
});