<s>
Secure	B-Application
cookies	I-Application
are	O
a	O
type	O
of	O
HTTP	B-Application
cookie	I-Application
that	O
have	O
Secure	O
attribute	O
set	O
,	O
which	O
limits	O
the	O
scope	O
of	O
the	O
cookie	B-Application
to	O
"	O
secure	O
"	O
channels	O
(	O
where	O
"	O
secure	O
"	O
is	O
defined	O
by	O
the	O
user	O
agent	O
,	O
typically	O
web	B-Application
browser	I-Application
)	O
.	O
</s>
<s>
When	O
a	O
cookie	B-Application
has	O
the	O
Secure	O
attribute	O
,	O
the	O
user	O
agent	O
will	O
include	O
the	O
cookie	B-Application
in	O
an	O
HTTP	O
request	O
only	O
if	O
the	O
request	O
is	O
transmitted	O
over	O
a	O
secure	O
channel	O
(	O
typically	O
HTTPS	O
)	O
.	O
</s>
<s>
Although	O
seemingly	O
useful	O
for	O
protecting	O
cookies	B-Application
from	O
active	O
network	O
attackers	O
,	O
the	O
Secure	O
attribute	O
protects	O
only	O
the	O
cookie	B-Application
's	O
confidentiality	O
.	O
</s>
<s>
An	O
active	O
network	O
attacker	O
can	O
overwrite	O
Secure	B-Application
cookies	I-Application
from	O
an	O
insecure	O
channel	O
,	O
disrupting	O
their	O
integrity	O
.	O
</s>
<s>
However	O
,	O
some	O
browsers	B-Application
,	O
including	O
Chrome	O
52	O
and	O
higher	O
and	O
Firefox	O
52	O
and	O
higher	O
,	O
forgo	O
this	O
specification	O
in	O
favor	O
of	O
better	O
security	O
and	O
forbid	O
insecure	O
sites	O
(	O
HTTP	O
)	O
from	O
setting	O
cookies	B-Application
with	O
the	O
Secure	O
directive	O
.	O
</s>
<s>
Even	O
with	O
Secure	O
,	O
some	O
sources	O
recommend	O
that	O
sensitive	O
information	O
never	O
be	O
stored	O
in	O
cookies	B-Application
,	O
on	O
the	O
premise	O
that	O
they	O
are	O
inherently	O
insecure	O
and	O
this	O
flag	O
ca	O
n't	O
offer	O
real	O
protection	O
.	O
</s>
<s>
Secure	O
attribute	O
is	O
not	O
the	O
only	O
protection	O
mechanism	O
for	O
cookies	B-Application
,	O
there	O
are	O
also	O
HttpOnly	O
and	O
SameSite	O
attributes	O
.	O
</s>
<s>
The	O
HttpOnly	O
attribute	O
restricts	O
the	O
cookie	B-Application
from	O
being	O
accessed	O
by	O
,	O
for	O
instance	O
,	O
JavaScript	B-Language
,	O
while	O
the	O
SameSite	O
attribute	O
only	O
allows	O
the	O
cookie	B-Application
to	O
be	O
sent	O
to	O
the	O
application	O
if	O
the	O
request	O
originated	O
from	O
the	O
same	O
domain	O
.	O
</s>
<s>
An	O
HTTP	B-Application
cookie	I-Application
is	O
a	O
small	O
packet	O
of	O
data	O
that	O
is	O
sent	O
from	O
a	O
web	O
server	O
to	O
a	O
user	O
's	O
web	B-Application
browser	I-Application
.	O
</s>
<s>
There	O
are	O
two	O
types	O
of	O
cookie	B-Application
:	O
</s>
<s>
Persistent	O
cookies	B-Application
-	O
Cookies	B-Application
that	O
store	O
information	O
in	O
the	O
user	O
's	O
browser	B-Application
for	O
a	O
long	O
time	O
.	O
</s>
<s>
Non-persistent	O
cookies	B-Application
-	O
Cookies	B-Application
that	O
generally	O
expire	O
when	O
the	O
browser	B-Application
closes	O
.	O
</s>
<s>
Cookies	B-Application
could	O
contain	O
sensitive	O
information	O
,	O
such	O
as	O
passwords	O
and	O
credit	O
card	O
numbers	O
,	O
which	O
are	O
sent	O
over	O
an	O
HTTP	O
connection	O
and	O
might	O
be	O
stored	O
in	O
web	B-Application
browsers	I-Application
as	O
plain	O
text	O
.	O
</s>
<s>
To	O
prevent	O
attackers	O
from	O
stealing	O
this	O
information	O
,	O
cookies	B-Application
can	O
be	O
secured	O
with	O
attributes	O
.	O
</s>
<s>
Various	O
cookie	B-Application
hijacking	O
techniques	O
exist	O
.	O
</s>
<s>
Cookies	B-Application
that	O
contain	O
sensitive	O
information	O
such	O
as	O
usernames	O
,	O
passwords	O
,	O
and	O
session	O
identifiers	O
can	O
be	O
captured	O
using	O
these	O
tools	O
once	O
they	O
are	O
downloaded	O
from	O
a	O
site	O
to	O
a	O
web	B-Application
browser	I-Application
or	O
accessed	O
through	O
a	O
computer	O
hard	O
drive	O
.	O
</s>
<s>
Cookies	B-Application
that	O
are	O
sent	O
over	O
unencrypted	O
channels	O
can	O
be	O
subject	O
to	O
eavesdropping	O
,	O
i.e.	O
</s>
<s>
the	O
contents	O
of	O
the	O
cookie	B-Application
can	O
be	O
read	O
by	O
the	O
attacker	O
.	O
</s>
<s>
These	O
types	O
of	O
threats	O
can	O
be	O
prevented	O
by	O
the	O
use	O
of	O
Secure	B-Protocol
Sockets	I-Protocol
Layer	I-Protocol
or	O
SSL	O
protocol	O
in	O
servers	O
and	O
Internet	B-Application
browsers	I-Application
although	O
this	O
works	O
only	O
if	O
the	O
cookies	B-Application
are	O
on	O
the	O
network	O
.	O
</s>
<s>
One	O
might	O
also	O
use	O
cookies	B-Application
with	O
only	O
the	O
sensitive	O
information	O
encrypted	O
instead	O
of	O
the	O
entirety	O
of	O
a	O
data	O
payload	O
exchanged	O
.	O
</s>
<s>
Cookies	B-Application
can	O
be	O
stolen	O
or	O
copied	O
from	O
the	O
user	O
,	O
which	O
could	O
either	O
reveal	O
the	O
information	O
in	O
the	O
cookies	B-Application
or	O
allow	O
the	O
attacker	O
to	O
edit	O
the	O
contents	O
of	O
the	O
cookies	B-Application
and	O
impersonate	O
the	O
users	O
.	O
</s>
<s>
This	O
happens	O
when	O
a	O
cookie	B-Application
,	O
which	O
is	O
in	O
the	O
browser	B-Application
's	O
end	O
system	O
and	O
stored	O
in	O
the	O
local	O
drive	O
or	O
memory	O
in	O
clear	O
text	O
,	O
is	O
altered	O
or	O
copied	O
from	O
one	O
computer	O
to	O
another	O
with	O
or	O
without	O
the	O
knowledge	O
of	O
the	O
user	O
.	O
</s>
<s>
The	O
attacker	O
can	O
try	O
to	O
impersonate	O
a	O
website	O
by	O
accepting	O
cookies	B-Application
from	O
the	O
users	O
.	O
</s>
<s>
Once	O
the	O
attacker	O
gets	O
the	O
cookies	B-Application
,	O
he	O
can	O
use	O
these	O
harvested	O
cookies	B-Application
for	O
websites	O
that	O
accept	O
third-party	O
cookies	B-Application
.	O
</s>
