<s>
Web	B-Application
storage	I-Application
,	O
sometimes	O
known	O
as	O
DOM	B-Application
storage	I-Application
(	O
Document	B-General_Concept
Object	I-General_Concept
Model	I-General_Concept
storage	O
)	O
,	O
is	O
a	O
standard	O
JavaScript	B-Language
API	B-Application
provided	O
by	O
web	B-Application
browsers	I-Application
.	O
</s>
<s>
It	O
enables	O
websites	O
to	O
store	O
persistent	B-Application
data	O
on	O
users	O
 '	O
devices	O
similar	O
to	O
cookies	B-Application
,	O
but	O
with	O
much	O
larger	O
capacity	O
and	O
no	O
information	O
sent	O
in	O
HTTP	B-Protocol
headers	I-Protocol
.	O
</s>
<s>
There	O
are	O
two	O
main	O
web	B-Application
storage	I-Application
types	O
:	O
local	O
storage	O
and	O
session	B-Application
storage	I-Application
,	O
behaving	O
similarly	O
to	O
persistent	B-Application
cookies	B-Application
and	O
session	O
cookies	B-Application
respectively	O
.	O
</s>
<s>
Web	B-Application
Storage	I-Application
is	O
standardized	O
by	O
the	O
World	O
Wide	O
Web	O
Consortium	O
(	O
W3C	O
)	O
and	O
WHATWG	B-Language
,	O
and	O
is	O
supported	O
by	O
all	O
major	O
browsers	B-Application
.	O
</s>
<s>
Web	B-Application
storage	I-Application
differs	O
from	O
cookies	B-Application
in	O
some	O
key	O
ways	O
.	O
</s>
<s>
Cookies	B-Application
are	O
intended	O
for	O
communication	O
with	O
servers	O
;	O
they	O
are	O
automatically	O
added	O
to	O
all	O
requests	O
and	O
can	O
be	O
accessed	O
by	O
both	O
the	O
server	O
and	O
client-side	O
.	O
</s>
<s>
Web	B-Application
storage	I-Application
falls	O
exclusively	O
under	O
the	O
purview	O
of	O
client-side	O
scripting	O
.	O
</s>
<s>
Web	B-Application
storage	I-Application
data	O
is	O
not	O
automatically	O
transmitted	O
to	O
the	O
server	O
in	O
every	O
HTTP	O
request	O
,	O
and	O
a	O
web	O
server	O
ca	O
n't	O
directly	O
write	O
to	O
Web	B-Application
storage	I-Application
.	O
</s>
<s>
Cookies	B-Application
are	O
restricted	O
to	O
4	O
kilobytes	O
.	O
</s>
<s>
Web	B-Application
storage	I-Application
provides	O
far	O
greater	O
storage	O
capacity	O
:	O
</s>
<s>
Web	B-Application
storage	I-Application
offers	O
two	O
different	O
storage	O
areas	O
—	O
local	O
storage	O
and	O
session	B-Application
storage	I-Application
—	O
which	O
differ	O
in	O
scope	O
and	O
lifetime	O
.	O
</s>
<s>
Data	O
placed	O
in	O
local	O
storage	O
is	O
per	O
origin	B-Protocol
—	O
the	O
combination	O
of	O
protocol	O
,	O
host	O
name	O
,	O
and	O
port	O
number	O
as	O
defined	O
in	O
the	O
same-origin	B-Protocol
policy	I-Protocol
.	O
</s>
<s>
The	O
data	O
is	O
available	O
to	O
all	O
scripts	O
loaded	O
from	O
pages	O
from	O
the	O
same	B-Protocol
origin	I-Protocol
that	O
previously	O
stored	O
the	O
data	O
and	O
persists	O
after	O
the	O
browser	B-Application
is	O
closed	O
.	O
</s>
<s>
As	O
such	O
,	O
Web	B-Application
storage	I-Application
does	O
not	O
suffer	O
from	O
cookie	B-Application
Weak	O
Integrity	O
and	O
Weak	O
Confidentiality	O
issues	O
,	O
described	O
in	O
sections	O
8.5	O
and	O
8.6	O
.	O
</s>
<s>
Session	B-Application
storage	I-Application
is	O
both	O
per-origin	O
and	O
per-instance	O
(	O
per-window	O
or	O
per-tab	O
)	O
and	O
is	O
limited	O
to	O
the	O
lifetime	O
of	O
the	O
instance	O
.	O
</s>
<s>
Session	B-Application
storage	I-Application
is	O
intended	O
to	O
allow	O
separate	O
instances	O
of	O
the	O
same	O
web	O
app	O
to	O
run	O
in	O
different	O
windows	B-Application
without	O
interfering	O
with	O
each	O
other	O
,	O
a	O
use	O
case	O
that	O
's	O
not	O
well	O
supported	O
by	O
cookies	B-Application
.	O
</s>
<s>
Web	B-Application
storage	I-Application
provides	O
a	O
better	O
programmatic	O
interface	O
than	O
cookies	B-Application
because	O
it	O
exposes	O
an	O
associative	B-Application
array	I-Application
data	B-Application
model	I-Application
where	O
the	O
keys	O
and	O
values	O
are	O
both	O
strings	O
.	O
</s>
<s>
An	O
additional	O
API	B-Application
for	O
accessing	O
structured	B-Application
data	I-Application
is	O
being	O
considered	O
by	O
the	O
W3C	O
Web	O
Applications	O
Working	O
Group	O
.	O
</s>
<s>
Browsers	B-Application
that	O
support	O
web	B-Application
storage	I-Application
have	O
the	O
global	O
objects	O
sessionStorage	B-Application
and	O
localStorage	O
declared	O
at	O
the	O
window	O
level	O
.	O
</s>
<s>
The	O
following	O
JavaScript	B-Language
code	O
can	O
be	O
used	O
on	O
these	O
browsers	B-Application
to	O
trigger	O
web	B-Application
storage	I-Application
behavior:Only	O
strings	O
can	O
be	O
stored	O
via	O
the	O
Storage	O
API	B-Application
.	O
</s>
<s>
Attempting	O
to	O
store	O
a	O
different	O
data	O
type	O
will	O
result	O
in	O
an	O
automatic	O
conversion	O
into	O
a	O
string	O
in	O
most	O
browsers	B-Application
.	O
</s>
<s>
Conversion	O
into	O
JSON	B-General_Concept
,	O
however	O
,	O
allows	O
for	O
effective	O
storage	O
of	O
JavaScript	B-Language
objects	O
.	O
</s>
<s>
The	O
W3C	O
draft	O
is	O
titled	O
"	O
Web	B-Application
Storage	I-Application
"	O
.	O
</s>
<s>
"	O
DOM	B-Application
storage	I-Application
"	O
has	O
also	O
been	O
a	O
commonly	O
used	O
name	O
,	O
though	O
it	O
is	O
becoming	O
less	O
so	O
;	O
for	O
example	O
the	O
"	O
DOM	B-Application
Storage	I-Application
"	O
web	O
articles	O
of	O
the	O
Mozilla	O
and	O
Microsoft	O
developer	O
sites	O
have	O
been	O
replaced	O
with	O
"	O
Web	B-Application
Storage	I-Application
"	O
articles	O
.	O
</s>
<s>
The	O
"	O
DOM	B-General_Concept
"	O
in	O
DOM	B-Application
storage	I-Application
does	O
not	O
literally	O
refer	O
to	O
the	O
Document	B-General_Concept
Object	I-General_Concept
Model	I-General_Concept
.	O
</s>
<s>
According	O
to	O
the	O
W3C	O
,	O
"	O
The	O
term	O
DOM	B-General_Concept
is	O
used	O
to	O
refer	O
to	O
the	O
API	B-Application
set	O
made	O
available	O
to	O
scripts	O
in	O
Web	O
applications	O
,	O
and	O
does	O
not	O
necessarily	O
imply	O
the	O
existence	O
of	O
an	O
actual	O
Document	O
object	O
...	O
"	O
</s>
<s>
Storage	O
of	O
web	B-Application
storage	I-Application
objects	O
is	O
enabled	O
by	O
default	O
in	O
current	O
versions	O
of	O
all	O
supporting	O
web	B-Application
browsers	I-Application
,	O
with	O
browser	B-Application
vendors	O
providing	O
ways	O
for	O
users	O
to	O
natively	O
enable	O
or	O
disable	O
web	B-Application
storage	I-Application
,	O
or	O
clear	O
the	O
web	B-Application
storage	I-Application
"	O
cache	O
"	O
.	O
</s>
<s>
Similar	O
controls	O
over	O
web	B-Application
storage	I-Application
are	O
also	O
available	O
through	O
3rd	O
party	O
browser	B-Protocol
extensions	I-Protocol
.	O
</s>
<s>
Each	O
browser	B-Application
stores	O
Web	B-Application
storage	I-Application
objects	O
differently	O
:	O
</s>
<s>
Firefox	B-Application
saves	O
Web	B-Application
storage	I-Application
objects	O
in	O
a	O
SQLite	B-Language
file	O
called	O
webappsstore.sqlite	O
in	O
the	O
user	O
's	O
profile	O
folder	O
.	O
</s>
<s>
Google	B-Application
Chrome	I-Application
records	O
Web	B-Application
storage	I-Application
data	O
in	O
a	O
SQLite	B-Language
file	O
in	O
the	O
user	O
's	O
profile	O
.	O
</s>
<s>
The	O
subfolder	O
containing	O
this	O
file	O
is	O
"	O
\AppData\Local\Google\Chrome\User	O
Data	O
\Default\Local	O
Storage	O
"	O
on	O
Windows	B-Application
,	O
and	O
"	O
~	O
/Library/Application	O
Support/Google/Chrome/Default/Local	O
Storage	O
"	O
on	O
macOS	B-Application
.	O
</s>
<s>
Opera	B-Application
's	O
Web	B-Application
storage	I-Application
is	O
located	O
in	O
either	O
"	O
\AppData\Roaming\Opera\Opera\sessions\autosave.win	O
 "	O
or	O
"	O
\AppData\Local\Opera\Opera\pstorage\	O
 "	O
depending	O
upon	O
Opera	B-Application
's	O
version	O
.	O
</s>
<s>
Internet	B-Application
Explorer	I-Application
's	O
Web	B-Application
storage	I-Application
is	O
"	O
\AppData\LocalLow\Microsoft\Internet	O
Explorer	O
\DOMStorage	O
 "	O
.	O
</s>
<s>
Safari	B-Application
's	O
Web	B-Application
Storage	I-Application
is	O
located	O
in	O
a	O
folder	O
labeled	O
"	O
LocalStorage	O
"	O
within	O
a	O
hidden	O
"	O
safari	B-Application
"	O
folder	O
.	O
</s>
