Completely log out of Shopify session such as clear applied gift cards after log out

For some reason Shopify’s cart session is not tied to a customer login, which causes issues of not being able to clear out sensitive info on the Shoping cart session such as applied gift card code, which allows other people to use the gift card code applied when the user was logged in, causing a serious security issue.

Is there any way to completely log out of a user session when a user logs out? My main use case is to prevent the gift card code applied when the user logged in being used by others, and there doesn’t seem to be a way to do that. I already tried /cart/clear.js but the gift card code still stays on checkout even after log out!

Sorry but you need to be more clear than that in order to receive constructive help.

From what I understand, except if you share your logged-in device (usually with somebody you know) then, maybe, they might have access. But this is more of an usage problem, it’s not like the gift card code is available to everyone.

Once the gift card code is applied at checkout and people log out, the gift card code still stays in the cart rather than getting removed, allowing the guest user using it.