This week's book giveaway is in the Kotlin forum.
We're giving away four copies of Kotlin in Action and have Dmitry Jemerov & Svetlana Isakova on-line!
See this thread for details.
Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Question on Session  RSS feed

 
rabi shanker
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,

This was a question asked to me during an interview and just wanted to know the excat answer for this.

In web application for handling the session we use the session api. What will happen when we disable the cookies in the browser and use the sessions api. When we use the session apis is it trying to write something into the cookies file?

And what is a jsessionid?

Thanks,

Rabi
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Chapter 7 of the Servlet spec covers sessions.
Specifically, section SRV7.1.4 says:
 
rabi shanker
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
May be I should have explained my question a bit more. When we use the http session object doest it try to make an entry into the cookies file?
Rabi
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
My answer is the same:
SRV 7 in the servlet spec (link in my signature) spells out exactly what an app server must do if the client doesn't return the session cookie header value.
 
Ram kovis
Ranch Hand
Posts: 130
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Rabi

There is no relation between HTTP session object and cookies .. Nothing happens to the cookies, when you use Http Session.
The server maintains this HTTP session.
This Tutorial on sessions should give you better idea.
[ September 02, 2005: Message edited by: Ram kovis ]
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Ram kovis:
Rabi

There is no relation between HTTP session object and cookies .. Nothing happens to the cookies, when you use Http Session.
The server maintains this HTTP session.
This Tutorial on sessions should give you better idea.

[ September 02, 2005: Message edited by: Ram kovis ]


I wouldn't say there is NO relation between sessions and cookies.
The first choice for maintaining session in every app server that I know about is via the JSPSession cookie.

Again, this is all covered in the spec.
It's a fairly easy and short read.
 
Rajesh Agarwal
Ranch Hand
Posts: 79
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The above answers are correct. Both are just differnt ways to track session values. It is just the need of the application whther to keep the session values in the client side or the server side. Yhe HTTP Session Object is maintained at the server side and the cookies are maintained at the client side
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!