File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Session management

 
Teajl Shah
Greenhorn
Posts: 11
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,
I have just started learning JSP and have some Qs.They may be very basic but I am confused,so please help me
1.What is the functional impact on the session when dial-up connection dropped between the requests but quickly reconnects(within few seconds)?
2.ServletRequest interface has a method getRemoteHost(),why can't we use the simple IP address to identify a perticular client?
Thanks all,
Tejal
 
Preethi M
Greenhorn
Posts: 22
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi shah!
Answers to ur questions:
1.if u close ur browser and open it again ur session gets expired.otherwise there will be no impact on session.it also depends on the expiry date of the cookie.
2.ur idea is very good,but think what if i am connected to a proxy server.for eg.if i am connected to a proxy server,users are shopping and their selected items are stored in a session,when we r retrieving the items they get replaced since it is the same IP address for all the clients.
hope u find this information useful.
thanks
preethi
 
Nitin Dabadghav
Greenhorn
Posts: 13
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
1) Your session terminates only when your browser is terminated or if you have specified a specific time for your session cookie.
But according to me If your connection fails or a few seconds it won't matter as the session will be the same.
2) In this case you are trying to hard code an IP address whereas different client have different IP addresses.
 
Teajl Shah
Greenhorn
Posts: 11
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Preethi and Nitin.It really helped
one more qs.
which session management technique requires minimal amount of code if we can control the clent(browser) configuration?
Thanx
Tejal
 
lokesh reddy
Ranch Hand
Posts: 66
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Shah,
HttpSession session management technique is very easy to implement and it requires a minimal amount of a code.
Try to implement this in ur project
 
Preethi M
Greenhorn
Posts: 22
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Teajl,
When dealing with small sets of public data using cookies or URL rewriting is accepatable.
when dealing with private and large amounts of data preffered method is to use HttpSession object.so by sending small amount of data to the client u can associate each user with large amount of data on the server.
Good Luck
Preethi
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic