Okay, before we move on and set up the get current user old.
Let's also that's the expiration.
At this point, I have showed you, I think, a few times where I basically remove the cookie.
But now let me showcase what.
Actually happens once the cookie expires.
And in order to test it, I'm just going to go to utils function and I'll change from one day to 5 seconds.
I'll log in and I'll show you what happens after 5 seconds.
So let's go to attach cookies.
I'll leave them one day.
Of course I'll go back.
Once we test that out, then let's say 5 seconds.
Now, again, we want to register because we want to get the new one.
Keep in mind, the cookie that right now is present has the previous expiration.
So.
Yes, yes.
We always need to start from scratch.
So let's go again.
With the failures.
Now we should get that five second one, the one that expires in 5 seconds.
And I'm just going to be extremely annoying and I'm just going to count to five.
So one, two, three, four, five.
We should be done.
And then notice technically everything works.
I can even go to roots and all that, but the moment I'm going to go back to the start, this is when
we again send back that cookie, correct?
Because we right away set up that request and you'll see since our cookie has expired.
Pam will be logged out right away.
So let's go back to Stats N Yep.
We cannot see the application anymore.
Why?
Well, because we get back the 401.
Or you can clearly see that.
So we get the four one.
Our interceptor still works and we right away lock out to user.
So let me go back to attach cookies.
I'm going to go back to that one day.
This is again, just to give you an idea of what happens.
And yes, let me log in one more time.
Otherwise, I know that I'm going to basically keep that one and I'll wonder why nothing works.
So now again, our expiration is that one day.