✅ – fateassassin – 09-23 Aug 31
Hey, I need some help with Cookies and User auth. So what I have is a HTTP-Only cookie, which includes a token for user validation on the backend. Now if that cookie doesnt exists anymore, because the user has, for example, logged out, I want to refrain from making an API call to check for the token, to minimize API-calls. Is that possible, as i cant check if the token exists on the frontend? If yes, what would be the approach?
Solution:
Don't prematurely optimize. Since you're using http only cookies, the only way for you to know whether a user is authenticated is by making a request
Message Not Public
Sign In & Join Server To View
✅ – fateassassin – 17-38 Aug 30
I am so confused right now, HTTP-Only cookies cant be edited through Javascript right, but for example I've got this extension on google that can delete the cookies? 🤔
even though also the "HTTP-Only" flag is checked...
Solution:
you basically having the extension allow this type of access to specific domains
snowberb – 20-34 Aug 23
If you had to recommend a resource to learn JavaScript to someone who has no base in programming, which book/course/resource would you suggest?
drilkmops – 15-59 Aug 19
This is gonna be a really dumb question I should know the answer to.
I’m building a localization library. I have a big list of locale data that I only need to load a portion of each time. I dont want my end users to need any additional setup.
Is there a way for a static website to like “lazy load” the extra locale data when they’re needed only? So when someone visits the static page they only get
en
, but if something for fr
is used, it “fetches” that data somehow? I’d like to not require additional fetches to other endpoints, but CDN is likely fine I suppose....snowberb – 08-55 Jul 4
Is it possible to use variables while importing a module?
I'm trying to dynamically import some module files but when I use variables it doesnt find the file
Works:
```js...