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

request/session variables management  RSS feed

 
Raef Kandeel
Ranch Hand
Posts: 87
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Can anybody explain to me in simple technical terms, when someone says: request/session variables management, what does he really mean? Please go easy on me, I am a newbie. Thanks.
 
Stan James
(instanceof Sidekick)
Ranch Hand
Posts: 8791
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The Sun Servlet Tutorial will do a much better job explaining than I might. But here's a short answer ...

When an HTTP request comes into a Servlet container, the container builds a Request object and calls your Servlet. You can get a lot of nifty information about the request - parameters, posted data, the client's address, headers, etc.

The HTTP protocol doesn't have any provision for the server to remember anything about the client from one request to the next. The Servlet spec adds the Session object for that. You can create one, save information on it during one request and get that information back on the next request. The "management" part is probably talking about being careful to not put too much on the Session or leave it there too long ... if you have a zillion users it can eat up a lot of memory.

Read the tutorial for a more thorough description of things. The "Head First Servlets" book is also recommended.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!