What is Session and cookies?Explain in detail with an
example?

Answer Posted / debapriya maity

we r all familiar with the method given below

HttpSession session==request.getSession(true);
what happen here

Container whenever gets a request for a session from a client,
it checks out whether the request is for existing or a new
one,how it does.


If a new session: creates a cookie(small text file) ,stuffs
the session id ,and send it to the client as apart of
response headers (Set Cookie:)

existing one---gets the sessionid ,searches for the matching
session and associate with the request.

Now thing if ur browser is cookies disable, what will happen
next?? :)

Is This Answer Correct ?    14 Yes 3 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the nested interface?

599


Can we execute a program without main?

540


which is advanced deep technology in java launched by the sun microsystem??? The answer is very logical If u need correct answer mail me at priya_gupta@gmail.com

3192


What is this keyword used for?

690


How would you dynamically allocate memory to an array?

595






What is the base class of all classes?

571


What is append in java?

631


How many bytes is a unicode character?

509


What is the instance of an object?

553


Can we create a class inside a class in java?

550


How many types of memory areas are allocated by jvm?

560


What is size of int in java?

548


What do you mean by singleton class in java?

516


Why are generics used?

522


What is a hashmap used for?

650