-
Notifications
You must be signed in to change notification settings - Fork 62
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Disable cookie store by default. #6
Comments
All sensible suggestions. I tried to find a workaround for this particular aspect
without success. When a cookie's Are you aware of any clever techniques that forfend transmission to the server? Now, if you'll indulge my curiosity, what kind(s) of data do you wish to store If the majority of ImmortalDB users want to store order of magnitude megabytes+ |
My use case is to store base64 images locally. I never want to send that to the server. The docs aren't clear on how I can instantiate a DB omitting cookies. I would expect something like this:
I don't transpile my code. I want to use the |
Absolutely. Here's how you can accomplish exactly that: <html>
<head>
<script src="immortal-db.min.js"></script>
<script>
;(async () => {
const stores = [ImmortalDB.LocalStorageStore, ImmortalDB.IndexedDbStore]
const db = ImmortalDB.ImmortalStorage(stores)
await db.set('hi', 'lolsup')
})()
</script>
</head>
...
</html> Live example: https://codepen.io/anon/pen/LqZvgy?editors=1001#0. Does that answer your question, @martindrapeau? |
A fair compromise could be: by default, Then, a new, brother instance of Users would then have a choice:
Users would, of course, remain free to instantiate new import { ImmortalStorage, CookieStore, LocalStorageStore } from 'immortal-db'
const stores = [CookieStore, LocalStorageStore]
const db = ImmortalStorage(stores) What do you guys think? |
I'd suggest disabling the cookie storage option by default, making it opt-in.
The text was updated successfully, but these errors were encountered: