I’m not sure I don’t do too much related to the user cookies, you could try using Floppy to store data in localstorage which is persistent.
I wouldn’t recommend storing sensitive information like the token in the browser without encrypting it however. If you are loading bubble via an iframe through a browser level plugin, the plugin should have permissions to store cookies, meaning if the user signs in via the iframe, it will store the bubble login cookie by default.
If you really need to store it in the browser, you can encrypt the token server side and salt it with a unix timestamp of when it expires, then store it in the user’s browser so that when you retrieve it, you can check if it’s still valid first and reissue it if necessary. By default, it has a 1 year expiration, so I’d probably generate the token and encrypt it as
[token]|[current date and time + 1 year]
This way when you retrieve it you can just have the unencrypted token split by “|” and item 1 will be the token itself, and item 2 will be the expiration date of the token.
1 Like