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 happens if an exception is throws from an object's destructor?

675


What are the advantages of java?

610


How do you avoid global variables?

646


Define how destructors are defined in java?

678


What are the steps in the jdbc connection?

658






We are seeing so many videos/audios as many web sited. But question is these videos or audios are stored in Databases ( Oracle, Mysql, Sybase,... ) or stored any file directory from there they will give the link for that? Pls explain and give sample code to achieve this one? Thanks, Seenu.

1564


How many bytes is a string in java?

619


How will you initialize an Applet?

705


Explain about the main() method in java?

688


What is a conditional equation?

646


How will you calculate the depth of a binary tree if the tree contains 15 nodes?

692


How many decimal places is a double?

633


Can we use a switch statement with strings?

653


How many types of operators are there?

620


What is singletonlist in java?

591