<s>
In	O
computer	B-General_Concept
science	I-General_Concept
and	O
networking	B-Architecture
in	O
particular	O
,	O
a	O
session	O
is	O
a	O
time-delimited	O
two-way	O
link	O
,	O
a	O
practical	O
(	O
relatively	O
high	O
)	O
layer	O
in	O
the	O
TCP/IP	B-Protocol
protocol	I-Protocol
enabling	O
interactive	O
expression	O
and	O
information	O
exchange	O
between	O
two	O
or	O
more	O
communication	O
devices	O
or	O
ends	O
–	O
be	O
they	O
computers	O
,	O
automated	B-Application
systems	I-Application
,	O
or	O
live	O
active	O
users	O
(	O
see	O
login	B-Operating_System
session	I-Operating_System
)	O
.	O
</s>
<s>
An	O
established	O
communication	B-Protocol
session	I-Protocol
may	O
involve	O
more	O
than	O
one	O
message	O
in	O
each	O
direction	O
.	O
</s>
<s>
A	O
session	O
is	O
typically	O
stateful	B-Application
,	O
meaning	O
that	O
at	O
least	O
one	O
of	O
the	O
communicating	O
parties	O
needs	O
to	O
hold	O
current	O
state	O
information	O
and	O
save	O
information	O
about	O
the	O
session	O
history	O
to	O
be	O
able	O
to	O
communicate	O
,	O
as	O
opposed	O
to	O
stateless	B-Protocol
communication	O
,	O
where	O
the	O
communication	O
consists	O
of	O
independent	O
requests	B-Protocol
with	O
responses	O
.	O
</s>
<s>
An	O
established	O
session	O
is	O
the	O
basic	O
requirement	O
to	O
perform	O
a	O
connection-oriented	B-Protocol
communication	I-Protocol
.	O
</s>
<s>
A	O
session	O
also	O
is	O
the	O
basic	O
step	O
to	O
transmit	O
in	O
connectionless	B-Protocol
communication	I-Protocol
modes	O
.	O
</s>
<s>
Communication	O
Transport	O
may	O
be	O
implemented	O
as	O
part	O
of	O
protocols	O
and	O
services	O
at	O
the	O
application	B-Application
layer	I-Application
,	O
at	O
the	O
session	B-Application
layer	I-Application
or	O
at	O
the	O
transport	B-Architecture
layer	I-Architecture
in	O
the	O
OSI	O
model	O
.	O
</s>
<s>
Application	B-Application
layer	I-Application
examples	O
:	O
</s>
<s>
Session	B-Application
layer	I-Application
example	O
:	O
</s>
<s>
Transport	B-Architecture
layer	I-Architecture
example	O
:	O
</s>
<s>
A	O
TCP	B-Protocol
session	O
,	O
which	O
is	O
synonymous	O
to	O
a	O
TCP	B-Protocol
virtual	B-Protocol
circuit	I-Protocol
,	O
a	O
TCP	B-Protocol
connection	O
,	O
or	O
an	O
established	O
TCP	B-Protocol
socket	I-Protocol
.	O
</s>
<s>
In	O
the	O
case	O
of	O
transport	B-Architecture
protocols	I-Architecture
that	O
do	O
not	O
implement	O
a	O
formal	O
session	B-Application
layer	I-Application
(	O
e.g.	O
,	O
UDP	B-Protocol
)	O
or	O
where	O
sessions	O
at	O
the	O
application	B-Application
layer	I-Application
are	O
generally	O
very	O
short-lived	O
(	O
e.g.	O
,	O
HTTP	B-Protocol
)	O
,	O
sessions	O
are	O
maintained	O
by	O
a	O
higher	O
level	O
program	O
using	O
a	O
method	O
defined	O
in	O
the	O
data	O
being	O
exchanged	O
.	O
</s>
<s>
For	O
example	O
,	O
an	O
HTTP	B-Protocol
exchange	O
between	O
a	O
browser	B-Application
and	O
a	O
remote	O
host	O
may	O
include	O
an	O
HTTP	B-Application
cookie	I-Application
which	O
identifies	O
state	O
,	O
such	O
as	O
a	O
unique	O
session	B-Protocol
ID	I-Protocol
,	O
information	O
about	O
the	O
user	O
's	O
preferences	O
or	O
authorization	O
level	O
.	O
</s>
<s>
HTTP/1.0	B-Protocol
was	O
thought	O
to	O
only	O
allow	O
a	O
single	O
request	O
and	O
response	O
during	O
one	O
Web/HTTP	O
Session	O
.	O
</s>
<s>
Protocol	O
version	O
HTTP/1.1	B-Protocol
improved	O
this	O
by	O
completing	O
the	O
Common	B-Language
Gateway	I-Language
Interface	I-Language
(	O
CGI	B-Language
)	O
,	O
making	O
it	O
easier	O
to	O
maintain	O
the	O
Web	O
Session	O
and	O
supporting	O
HTTP	B-Application
cookies	I-Application
and	O
file	O
uploads	O
.	O
</s>
<s>
Most	O
client-server	B-Operating_System
sessions	O
are	O
maintained	O
by	O
the	O
transport	B-Architecture
layer	I-Architecture
-	O
a	O
single	O
connection	O
for	O
a	O
single	O
session	O
.	O
</s>
<s>
However	O
each	O
transaction	O
phase	O
of	O
a	O
Web/HTTP	O
session	O
creates	O
a	O
separate	O
connection	O
.	O
</s>
<s>
Maintaining	O
session	O
continuity	O
between	O
phases	O
requires	O
a	O
session	B-Protocol
ID	I-Protocol
.	O
</s>
<s>
The	O
session	B-Protocol
ID	I-Protocol
is	O
embedded	O
within	O
the	O
A	O
HREF	O
or	O
FORM	O
links	O
of	O
dynamic	O
web	O
pages	O
so	O
that	O
it	O
is	O
passed	O
back	O
to	O
the	O
CGI	B-Language
.	O
</s>
<s>
CGI	B-Language
then	O
uses	O
the	O
session	B-Protocol
ID	I-Protocol
to	O
ensure	O
session	O
continuity	O
between	O
transaction	O
phases	O
.	O
</s>
<s>
TCP	B-Protocol
sessions	O
are	O
typically	O
implemented	O
in	O
software	O
using	O
child	O
processes	O
and/or	O
multithreading	B-Operating_System
,	O
where	O
a	O
new	O
process	O
or	O
thread	B-Operating_System
is	O
created	O
when	O
the	O
computer	O
establishes	O
or	O
joins	O
a	O
session	O
.	O
</s>
<s>
HTTP	B-Protocol
sessions	O
are	O
typically	O
not	O
implemented	O
using	O
one	O
thread	B-Operating_System
per	O
session	O
,	O
but	O
by	O
means	O
of	O
a	O
database	O
with	O
information	O
about	O
the	O
state	O
of	O
each	O
session	O
.	O
</s>
<s>
The	O
advantage	O
with	O
multiple	O
processes	O
or	O
threads	B-Operating_System
is	O
relaxed	O
complexity	O
of	O
the	O
software	O
,	O
since	O
each	O
thread	B-Operating_System
is	O
an	O
instance	O
with	O
its	O
own	O
history	O
and	O
encapsulated	O
variables	O
.	O
</s>
<s>
When	O
a	O
client	B-Protocol
may	O
connect	O
to	O
any	O
server	B-Application
in	O
a	O
cluster	B-Architecture
of	O
servers	O
,	O
a	O
special	O
problem	O
is	O
encountered	O
in	O
maintaining	O
consistency	O
when	O
the	O
servers	O
must	O
maintain	O
session	O
state	O
.	O
</s>
<s>
The	O
client	B-Protocol
must	O
either	O
be	O
directed	O
to	O
the	O
same	O
server	B-Application
for	O
the	O
duration	O
of	O
the	O
session	O
,	O
or	O
the	O
servers	O
must	O
transmit	O
server-side	O
session	O
information	O
via	O
a	O
shared	O
file	O
system	O
or	O
database	O
.	O
</s>
<s>
Otherwise	O
,	O
the	O
client	B-Protocol
may	O
reconnect	O
to	O
a	O
different	O
server	B-Application
than	O
the	O
one	O
it	O
started	O
the	O
session	O
with	O
,	O
which	O
will	O
cause	O
problems	O
when	O
the	O
new	O
server	B-Application
does	O
not	O
have	O
access	O
to	O
the	O
stored	O
state	O
of	O
the	O
old	O
one	O
.	O
</s>
<s>
Server-side	O
sessions	O
are	O
handy	O
and	O
efficient	O
,	O
but	O
can	O
become	O
difficult	O
to	O
handle	O
in	O
conjunction	O
with	O
load-balancing/high	O
-availability	O
systems	O
and	O
are	O
not	O
usable	O
at	O
all	O
in	O
some	O
embedded	O
systems	O
with	O
no	O
storage	O
.	O
</s>
<s>
The	O
load-balancing	O
problem	O
can	O
be	O
solved	O
by	O
using	O
shared	O
storage	O
or	O
by	O
applying	O
forced	O
peering	O
between	O
each	O
client	B-Protocol
and	O
a	O
single	O
server	B-Application
in	O
the	O
cluster	B-Architecture
,	O
although	O
this	O
can	O
compromise	O
system	O
efficiency	O
and	O
load	O
distribution	O
.	O
</s>
<s>
A	O
method	O
of	O
using	O
server-side	O
sessions	O
in	O
systems	O
without	O
mass-storage	O
is	O
to	O
reserve	O
a	O
portion	O
of	O
RAM	O
for	O
storage	O
of	O
session	O
data	O
.	O
</s>
<s>
router	O
or	O
access	O
point	O
with	O
infrequent	O
or	O
disallowed	O
access	O
to	O
more	O
than	O
one	O
client	B-Protocol
at	O
a	O
time	O
)	O
.	O
</s>
<s>
Client-side	B-Operating_System
sessions	O
use	O
cookies	B-Application
and	O
cryptographic	O
techniques	O
to	O
maintain	O
state	O
without	O
storing	O
as	O
much	O
data	O
on	O
the	O
server	B-Application
.	O
</s>
<s>
When	O
presenting	O
a	O
dynamic	O
web	O
page	O
,	O
the	O
server	B-Application
sends	O
the	O
current	O
state	O
data	O
to	O
the	O
client	B-Protocol
(	O
web	B-Application
browser	I-Application
)	O
in	O
the	O
form	O
of	O
a	O
cookie	B-Application
.	O
</s>
<s>
The	O
client	B-Protocol
saves	O
the	O
cookie	B-Application
in	O
memory	O
or	O
on	O
disk	O
.	O
</s>
<s>
With	O
each	O
successive	O
request	O
,	O
the	O
client	B-Protocol
sends	O
the	O
cookie	B-Application
back	O
to	O
the	O
server	B-Application
,	O
and	O
the	O
server	B-Application
uses	O
the	O
data	O
to	O
"	O
remember	O
"	O
the	O
state	O
of	O
the	O
application	O
for	O
that	O
specific	O
client	B-Protocol
and	O
generate	O
an	O
appropriate	O
response	O
.	O
</s>
<s>
This	O
mechanism	O
may	O
work	O
well	O
in	O
some	O
contexts	O
;	O
however	O
,	O
data	O
stored	O
on	O
the	O
client	B-Protocol
is	O
vulnerable	O
to	O
tampering	O
by	O
the	O
user	O
or	O
by	O
software	O
that	O
has	O
access	O
to	O
the	O
client	B-Protocol
computer	I-Protocol
.	O
</s>
<s>
To	O
use	O
client-side	B-Operating_System
sessions	O
where	O
confidentiality	O
and	O
integrity	O
are	O
required	O
,	O
the	O
following	O
must	O
be	O
guaranteed	O
:	O
</s>
<s>
Confidentiality	O
:	O
Nothing	O
apart	O
from	O
the	O
server	B-Application
should	O
be	O
able	O
to	O
interpret	O
session	O
data	O
.	O
</s>
<s>
Data	O
integrity	O
:	O
Nothing	O
apart	O
from	O
the	O
server	B-Application
should	O
manipulate	O
session	O
data	O
(	O
accidentally	O
or	O
maliciously	O
)	O
.	O
</s>
<s>
Authenticity	O
:	O
Nothing	O
apart	O
from	O
the	O
server	B-Application
should	O
be	O
able	O
to	O
initiate	O
valid	B-Protocol
sessions	I-Protocol
.	O
</s>
<s>
To	O
accomplish	O
this	O
,	O
the	O
server	B-Application
needs	O
to	O
encrypt	O
the	O
session	O
data	O
before	O
sending	O
it	O
to	O
the	O
client	B-Protocol
,	O
and	O
modification	O
of	O
such	O
information	O
by	O
any	O
other	O
party	O
should	O
be	O
prevented	O
via	O
cryptographic	O
means	O
.	O
</s>
<s>
Transmitting	O
state	O
back	O
and	O
forth	O
with	O
every	O
request	O
is	O
only	O
practical	O
when	O
the	O
size	O
of	O
the	O
cookie	B-Application
is	O
small	O
.	O
</s>
<s>
In	O
essence	O
,	O
client-side	B-Operating_System
sessions	O
trade	O
server	B-Application
disk	O
space	O
for	O
the	O
extra	O
bandwidth	O
that	O
each	O
web	O
request	O
will	O
require	O
.	O
</s>
<s>
Moreover	O
,	O
web	B-Application
browsers	I-Application
limit	O
the	O
number	O
and	O
size	O
of	O
cookies	B-Application
that	O
may	O
be	O
stored	O
by	O
a	O
web	O
site	O
.	O
</s>
<s>
To	O
improve	O
efficiency	O
and	O
allow	O
for	O
more	O
session	O
data	O
,	O
the	O
server	B-Application
may	O
compress	O
the	O
data	O
before	O
creating	O
the	O
cookie	B-Application
,	O
decompressing	O
it	O
later	O
when	O
the	O
cookie	B-Application
is	O
returned	O
by	O
the	O
client	B-Protocol
.	O
</s>
<s>
A	O
session	B-Protocol
token	I-Protocol
is	O
a	O
unique	O
identifier	O
that	O
is	O
generated	O
and	O
sent	O
from	O
a	O
server	B-Application
to	O
a	O
client	B-Protocol
to	O
identify	O
the	O
current	O
interaction	O
session	O
.	O
</s>
<s>
The	O
client	B-Protocol
usually	O
stores	O
and	O
sends	O
the	O
token	O
as	O
an	O
HTTP	B-Application
cookie	I-Application
and/or	O
sends	O
it	O
as	O
a	O
parameter	O
in	O
GET	O
or	O
POST	O
queries	O
.	O
</s>
<s>
The	O
reason	O
to	O
use	O
session	B-Protocol
tokens	I-Protocol
is	O
that	O
the	O
client	B-Protocol
only	O
has	O
to	O
handle	O
the	O
identifier	O
—	O
all	O
session	O
data	O
is	O
stored	O
on	O
the	O
server	B-Application
(	O
usually	O
in	O
a	O
database	O
,	O
to	O
which	O
the	O
client	B-Protocol
does	O
not	O
have	O
direct	O
access	O
)	O
linked	O
to	O
that	O
identifier	O
.	O
</s>
<s>
Examples	O
of	O
the	O
names	O
that	O
some	O
programming	O
languages	O
use	O
when	O
naming	O
their	O
HTTP	B-Application
cookie	I-Application
include	O
JSESSIONID	B-Protocol
(	O
JSP	B-Language
)	O
,	O
PHPSESSID	B-Protocol
(	O
PHP	B-Application
)	O
,	O
CGISESSID	O
(	O
CGI	B-Language
)	O
,	O
and	O
ASPSESSIONID	O
(	O
ASP	B-General_Concept
)	O
.	O
</s>
<s>
In	O
human	O
–	O
computer	O
interaction	O
,	O
session	B-Protocol
management	I-Protocol
is	O
the	O
process	O
of	O
keeping	O
track	O
of	O
a	O
user	O
's	O
activity	O
across	O
sessions	O
of	O
interaction	O
with	O
the	O
computer	O
system	O
.	O
</s>
<s>
Typical	O
session	B-Protocol
management	I-Protocol
tasks	O
in	O
a	O
desktop	O
environment	O
include	O
keeping	O
track	O
of	O
which	O
applications	O
are	O
open	O
and	O
which	O
documents	O
each	O
application	O
has	O
opened	O
,	O
so	O
that	O
the	O
same	O
state	O
can	O
be	O
restored	O
when	O
the	O
user	O
logs	O
out	O
and	O
logs	O
in	O
later	O
.	O
</s>
<s>
For	O
a	O
website	O
,	O
session	B-Protocol
management	I-Protocol
might	O
involve	O
requiring	O
the	O
user	O
to	O
re-login	O
if	O
the	O
session	O
has	O
expired	O
(	O
i.e.	O
,	O
a	O
certain	O
time	O
limit	O
has	O
passed	O
without	O
user	O
activity	O
)	O
.	O
</s>
<s>
It	O
is	O
also	O
used	O
to	O
store	O
information	O
on	O
the	O
server-side	O
between	O
HTTP	B-Protocol
requests	I-Protocol
.	O
</s>
<s>
Session	B-Protocol
management	I-Protocol
on	O
Linux-based	O
systems	O
is	O
provided	O
by	O
X	B-Device
session	I-Device
manager	I-Device
.	O
</s>
<s>
On	O
Microsoft	B-Application
Windows	I-Application
systems	O
,	O
session	B-Protocol
management	I-Protocol
is	O
provided	O
by	O
the	O
Session	O
Manager	O
Subsystem	O
(	O
smss.exe	O
)	O
;	O
user	O
session	O
functionality	O
can	O
be	O
extended	O
by	O
third-party	O
applications	O
like	O
twinsplay	O
.	O
</s>
<s>
Session	B-Protocol
management	I-Protocol
is	O
particularly	O
useful	O
in	O
a	O
web	B-Application
browser	I-Application
where	O
a	O
user	O
can	O
save	O
all	O
open	O
pages	O
and	O
settings	O
and	O
restore	O
them	O
at	O
a	O
later	O
date	O
or	O
on	O
a	O
different	O
computer	O
(	O
see	O
data	B-Application
portability	I-Application
)	O
.	O
</s>
<s>
Google	B-Application
Chrome	I-Application
,	O
Mozilla	B-Application
Firefox	I-Application
,	O
Internet	B-Application
Explorer	I-Application
,	O
OmniWeb	B-Protocol
and	O
Opera	B-Application
are	O
examples	O
of	O
web	B-Application
browsers	I-Application
that	O
support	O
session	B-Protocol
management	I-Protocol
.	O
</s>
<s>
Session	B-Protocol
management	I-Protocol
is	O
often	O
managed	O
through	O
the	O
application	O
of	O
cookies	B-Application
.	O
</s>
<s>
Hypertext	B-Protocol
Transfer	I-Protocol
Protocol	I-Protocol
(	O
HTTP	B-Protocol
)	O
is	O
stateless	B-Protocol
.	O
</s>
<s>
Session	B-Protocol
management	I-Protocol
is	O
the	O
technique	O
used	O
by	O
the	O
web	O
developer	O
to	O
make	O
the	O
stateless	B-Protocol
HTTP	B-Protocol
protocol	I-Protocol
support	O
session	O
state	O
.	O
</s>
<s>
For	O
example	O
,	O
once	O
a	O
user	O
has	O
been	O
authenticated	O
to	O
the	O
web	O
server	B-Application
,	O
the	O
user	O
's	O
next	O
HTTP	B-Protocol
request	O
(	O
GET	O
or	O
POST	O
)	O
should	O
not	O
cause	O
the	O
web	O
server	B-Application
to	O
ask	O
for	O
the	O
user	O
's	O
account	O
and	O
password	O
again	O
.	O
</s>
<s>
In	O
situations	O
where	O
multiple	O
web	O
servers	O
must	O
share	O
knowledge	O
of	O
session	O
state	O
(	O
as	O
is	O
typical	O
in	O
a	O
cluster	B-Architecture
environment	O
)	O
session	O
information	O
must	O
be	O
shared	O
between	O
the	O
cluster	B-Architecture
nodes	O
that	O
are	O
running	O
web	O
server	B-Application
software	I-Application
.	O
</s>
<s>
Methods	O
for	O
sharing	O
session	O
state	O
between	O
nodes	O
in	O
a	O
cluster	B-Architecture
include	O
:	O
multicasting	O
session	O
information	O
to	O
member	O
nodes	O
(	O
see	O
JGroups	B-Language
for	O
one	O
example	O
of	O
this	O
technique	O
)	O
,	O
sharing	O
session	O
information	O
with	O
a	O
partner	O
node	O
using	O
distributed	B-Operating_System
shared	I-Operating_System
memory	I-Operating_System
or	O
memory	B-General_Concept
virtualization	I-General_Concept
,	O
sharing	O
session	O
information	O
between	O
nodes	O
using	O
network	B-Protocol
sockets	I-Protocol
,	O
storing	O
session	O
information	O
on	O
a	O
shared	O
file	O
system	O
such	O
as	O
a	O
distributed	B-Protocol
file	I-Protocol
system	I-Protocol
or	O
a	O
global	B-Application
file	I-Application
system	I-Application
,	O
or	O
storing	O
the	O
session	O
information	O
outside	O
the	O
cluster	B-Architecture
in	O
a	O
database	O
.	O
</s>
<s>
In	O
a	O
service-oriented	O
architecture	O
,	O
Simple	O
Object	O
Access	O
Protocol	O
or	O
SOAP	B-Application
messages	O
constructed	O
with	O
Extensible	B-Protocol
Markup	I-Protocol
Language	I-Protocol
(	O
XML	B-Protocol
)	O
messages	O
can	O
be	O
used	O
by	O
consumer	O
applications	O
to	O
cause	O
web	O
servers	O
to	O
create	O
sessions	O
.	O
</s>
<s>
Just	O
as	O
HTTP	B-Protocol
is	O
a	O
stateless	B-Protocol
protocol	I-Protocol
,	O
so	O
is	O
SMS	B-Device
.	O
</s>
<s>
As	O
SMS	B-Device
became	O
interoperable	O
across	O
rival	O
networks	O
in	O
1999	O
,	O
and	O
text	O
messaging	O
started	O
its	O
ascent	O
towards	O
becoming	O
a	O
ubiquitous	O
global	O
form	O
of	O
communication	O
,	O
various	O
enterprises	O
became	O
interested	O
in	O
using	O
the	O
SMS	B-Device
channel	O
for	O
commercial	O
purposes	O
.	O
</s>
<s>
Initial	O
services	O
did	O
not	O
require	O
session	B-Protocol
management	I-Protocol
since	O
they	O
were	O
only	O
one-way	O
communications	O
(	O
for	O
example	O
,	O
in	O
2000	O
,	O
the	O
first	O
mobile	O
news	O
service	O
was	O
delivered	O
via	O
SMS	B-Device
in	O
Finland	O
)	O
.	O
</s>
<s>
The	O
development	O
of	O
interactive	O
enterprise	O
applications	O
required	O
session	B-Protocol
management	I-Protocol
,	O
but	O
because	O
SMS	B-Device
is	O
a	O
stateless	B-Protocol
protocol	I-Protocol
as	O
defined	O
by	O
the	O
GSM	O
standards	O
,	O
early	O
implementations	O
were	O
controlled	O
client-side	B-Operating_System
by	O
having	O
the	O
end-users	O
enter	O
commands	O
and	O
service	O
identifiers	O
manually	O
.	O
</s>
