Jane Foster
Jane Foster

Reputation: 471

What is actually a session?

This question remains in my mind for quite a long time. I have read some descriptions about this concept ( a common one in computer networking). However, those explanations are very terminological, and I still do not get it.

Can someone help explain what is actually a session in a concise way? What purposes a session is used for? Examples and good references are helpful.

Upvotes: 3

Views: 2869

Answers (2)

Andres
Andres

Reputation: 10707

In short, it's a message interchange between two or more parts, that may be stateful or not. An example is you connecting to Amazon, storing things in your shopping cart, paying, and quitting.

A stateful session (like the previous example), may be represented in the server by an object (As Java HttpSession). However, this object is not the session but merely a representation of it's state.

For more details:

http://en.wikipedia.org/wiki/Session_(computer_science)

Upvotes: 4

Abhishek Potnis
Abhishek Potnis

Reputation: 897

In simple words, a session is conversation or dialogue between devices. You could compare a session with a telephone conversation in which a person A calls B, B when ready to talk receives the call and both A and B can now talk, this is when we can say the session is established. When either of A or B hang up, we can say that the session is terminated.

Now take a look at Wikipedia's definition -

In computer science, in particular networking, a session is a semi-permanent interactive information interchange, also known as a dialogue, a conversation or a meeting, between two or more communicating devices, or between a computer and user.

The term semi-permanent because even in your telephone conversation A is not permanently connected to B.

In Networking, session is usually maintained between a user(client) and a server. You can relate it to a simple Login scenario like Facebook, when you login, a session gets established between your machine(browser) and the server, that explains even when you open Facebook in a new tab, you are still signed in, and when you logout the session is terminated.

You could refer Wikipedia for more details.

I hope this helps.

Upvotes: 2

Related Questions