I want to store the access tokens in cookies so that they are shareable across tabs, but my requirement is I want to clear the tokens when all the browser tabs are closed or the entire browser is closed. So I am really not sure what to provide in the expires column so that it can clear them on closing the browser tab.
I am not using localStorage because it is tough to clear tokens when the browser is closed, and the event listeners are not up to the mark.
And the same case for Session storage, it works like a charm, but it is hard to pass the token across tabs, and still using some workarounds, it is not up to the mark
So can anyone please help me on how to work on this requirement using cookies in react?
Thanks in advance!!!