[Boards: 3 / a / aco / adv / an / asp / b / bant / biz / c / can / cgl / ck / cm / co / cock / d / diy / e / fa / fap / fit / fitlit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mlpol / mo / mtv / mu / n / news / o / out / outsoc / p / po / pol / qa / qst / r / r9k / s / s4s / sci / soc / sp / spa / t / tg / toy / trash / trv / tv / u / v / vg / vint / vip / vp / vr / w / wg / wsg / wsr / x / y ] [Search | Free Show | Home]

What are cookies for? i mean, for what can it be used? i know

This is a blue board which means that it's for everybody (Safe For Work content only). If you see any adult content, please report it.

Thread replies: 14
Thread images: 3

File: 7182365524_6135046e87.jpg (104KB, 500x333px) Image search: [Google]
7182365524_6135046e87.jpg
104KB, 500x333px
What are cookies for? i mean, for what can it be used? i know what they does but i don't see any useful use in them... in what you use cookies anon?

pd: i'm learning php, please don't be rude.
>>
>>57964787
Storing client-side user preferences, such as language, region, etc. Very useful on sites that don't have accounts.
>>
HTTP is stateless on the client-side, cookies provide client-side state.

How you use that is up to you: some use it to store session info, some use it to store local preferences, others use it for analytics.
>>
>>57964878 like 4chan?
>>
>>57964899
HTTP is a stateless protocol on both sides. One could argue that the fact that the server has a database which keeps information on the client's cookies means it has state, but really it's just a tacked on function. HTTP itself has no state.
>>
File: 161212-16.16.50.png (35KB, 507x399px) Image search: [Google]
161212-16.16.50.png
35KB, 507x399px
>>57964913
Exactly.

>>57964899
Also this, which is why you generally don't want to allow cookies for anything but the 1st-party site.
>>
>>57964946
State is described in HTTP a lot. For example, GET may not change state while POST may.

Or, a more simple approach: if HTTP was stateless, then repeating random HTTP requests would always result in the same (or at least a likewise) response, but this is not the case after, for example, a valid DELETE request.
>>
>>57964787
spyng
>>
>>57964787
> What are cookies for?

Sessions. Call:

<?php session_start(); ?>


and then you will have the $_SESSION variable available to store persistent information across pages. It's implemented using cookies. Example:

<?php session_start(); ?>
You have loaded a total of <?= ++$_SESSION["count"] ?> pages from this site so far.
>>
>>57964878
>sites that don't have accounts.

lol, but anon, how do even sites WITH accounts store the 1 information saying that (YOU) are USERNo.57964878

yeah thats right, cookies, flashcookies, or "localstorage" which is just a fancy cookie only accessible via javascript instead (iirc) of sent via http headers

>inb4 IP-only matching or session enabled protocols
>>
>>57965248
>>57965248
>GET may not change state
what about a FAGGOT http anon, can that change the thread state?

that state in the RFC is in the context of "server state", a PUT DELE or POST http request will generate the same result no matter which computer sent it, as long as all request headers are there, so thats stateless
>>
>>57966265
>>57966265
>no matter which


and no matter if its the first communication sent to the http server, you didnt initiate a session to confirm credentials, the http just accepted your DELETE and passed it on to the backend,
>>
>>57965286
/thread
don't let any other faggot shipost itt try to distract from teh troof.
>>
File: CookieMonster.jpg (44KB, 369x371px) Image search: [Google]
CookieMonster.jpg
44KB, 369x371px
>>57964787
Thread posts: 14
Thread images: 3


[Boards: 3 / a / aco / adv / an / asp / b / bant / biz / c / can / cgl / ck / cm / co / cock / d / diy / e / fa / fap / fit / fitlit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mlpol / mo / mtv / mu / n / news / o / out / outsoc / p / po / pol / qa / qst / r / r9k / s / s4s / sci / soc / sp / spa / t / tg / toy / trash / trv / tv / u / v / vg / vint / vip / vp / vr / w / wg / wsg / wsr / x / y] [Search | Top | Home]

I'm aware that Imgur.com will stop allowing adult images since 15th of May. I'm taking actions to backup as much data as possible.
Read more on this topic here - https://archived.moe/talk/thread/1694/


If you need a post removed click on it's [Report] button and follow the instruction.
DMCA Content Takedown via dmca.com
All images are hosted on imgur.com.
If you like this website please support us by donating with Bitcoins at 16mKtbZiwW52BLkibtCr8jUg2KVUMTxVQ5
All trademarks and copyrights on this page are owned by their respective parties.
Images uploaded are the responsibility of the Poster. Comments are owned by the Poster.
This is a 4chan archive - all of the content originated from that site.
This means that RandomArchive shows their content, archived.
If you need information for a Poster - contact them.