I'm new to firebase, and I can't figure out how to keep the user logged in after going to a different page. I'm able to successfully log in and post user data to the console on the log in page, but when I go to a different page and try to get the user information using *firebase.auth().currentUser*. I initially had it immediately redirect to another page after the log in was completed, and turned it off to see if I was leaving the page before the information was relayed to the server, but that did not fix it. I also tried to manually set the persistence to no avail. I've looked around here and haven't found anything that fixes the problem.

Here is my sign in method (which is basically the same thing as what's on firebase docs), which is called when the sign in button on the form is clicked:

```
function signIn(){
    //getting credential input from form
    var email = document.getElementById('email').value;
    var password = document.getElementById('password').value;
    console.log(email, password)
    //calling firebase to sign in user
    firebase.auth().signInWithEmailAndPassword(email, password)
    .then(cred => {
        //confirmation that user signed in
        console.log("signed in");
    }).catch(function(error) {
        var errorCode = error.code;
        var errorMsg = error.message;
        if(errorCode === 'auth/wrong-password') {
            alert('Wrong Password');
        }
        else {
            alert(errorMsg);
        }
        console.log(error);
    });
};

```