Ranter
Join devRant
Do all the things like
++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatar
Sign Up
Pipeless API
From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple API
Learn More
Comments
-
@bcye it takes like 3 nanoseconds to learn about them
https://w3schools.com/js/... -
Fexell6567yThis is just ridiculous. If you have a large application, or website, it is usually in your, and your visitors, best interest to have cookies. Just because there are bad companies out there that exploit the use of cookies, doesn't mean every company/website do it. It would be like saying "fuck all drivers", to remark drivers (that are drunk, high, etc) and causes accidents.
The only thing I can agree on is that there are a lot of websites that uses cookies excessively, to, like as you're implying; collect as much information about a person as possible. -
@Fexell tell me 3 things except user that should be stored in cookies and ill believe you
-
Fexell6567y@BindView What are you asking? Sorry, but I don't understand what you're trying to ask?
If you mean by giving examples of where cookies are a good thing, I can give you a few: Register-forms (so you don't have to type shit over and over), login session cookies (so you stay logged in), save functions, AJAX 1-page sites (to example store browser path, so when you press F5 it stays on the same content). You know, small things that makes the user experience smooth and fun. People that are afraid of cookies either don't understand their use or have too often met with the exceptions, where websites use them for bad things.
There's an old saying: "don't shoot the mail man", which applies quite well to cookies. -
@BindView I use for just one thing: store the user preference without creating a login area. After all, it is just a tiny preference.
-
SSDD47607y@BindView you just mentioned “user”. How do you facilitate a logged in user without cookies or sessions?
-
SSDD47607y@BindView my point was...... you say you don’t use cookies, but how do facilitate a logged in session?
-
@vlatkozelka ask the comment section, apparently they store their fucking birth certificates in cookies
-
@vlatkozelka sorry to break the bubble but react for example uses a different html
-
Froot75397y@BindView Good for you.
As long as you don't have login, shopping cart or anything else that requires persistence on your site.
Tho, tell me again, how is a web server connecting two request together to the same user invading your privacy? -
Froot75397y@BindView Ok I read your comments and congrats man, you're a grade A fucking moron.
Sessions, sessions use a cookie to establish who it is your talking to.
React doesn't use different html. They use jsx. It might look like html but it's in fact some Babel wizardry that transpiles to good old JS that then intelligently produces the good old HTML for you, thus removing the need to fiddle with the Dom yourself.
Someone mentioned that spa-s need cookies so you don't go back to the index on refresh. No. Spa-s change the URL without you navigating so you sit on the same page but it looks like your moving between pages since the URL changes. They also store that in browser history so back/forth navigations works. Now if you've moved away from the index and hit refresh you will send a request for that... let's call it "virtual URL"... to the server. But since your server is set up to serve the index file on 404s, you get a nice page back and he client side router does the rest. -
Froot75397y@BindView Well someone did. And you seemed so proud of your no cookie site that it was the logical assumption to make 😄
-
Froot75397y@vlatkozelka No probs, I'll try to explain it as best I can
Cookies: The only thing you need to, and should, keep in cookies is the session id. Storing nothing more in there is just setting yourself up for trouble for various reasons. Basically, a cookie's only purpose is to tie separate requests together so you can have some persistence in your application. Without them all you'd have is just a bunch of random http requests and you'd never know who sent what.
Offline stuff: that is also relevant in web apps but you don't use cookies to store data, you use local storage. -
Froot75397y@vlatkozelka No no no.
You don't store anything but the session id in the cookie.
Whenever the user adds something to their cart they send a request to the server to do so. You use the cookie to understand which of those requests come from the same guy so you can update his cart and show the correct items in it.
I guess you could use local storage for it... Hmmm... That's an interesting idea
Welcome to every website that i make
rant