This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Servlets and the fly likes Session management Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "Session management" Watch "Session management" New topic
Author

Session management

Teajl Shah
Greenhorn

Joined: Jun 02, 2000
Posts: 11
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

Joined: Oct 24, 2000
Posts: 22
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

Joined: Jun 28, 2000
Posts: 13
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

Joined: Jun 02, 2000
Posts: 11
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

Joined: Sep 15, 2000
Posts: 66
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

Joined: Oct 24, 2000
Posts: 22
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
 
Don't get me started about those stupid light bulbs.
 
subject: Session management
 
Similar Threads
How to access CMR-fields in SessionBeans
how to kill session in transportsession scope of axis2?
session timeout
object dies when redirect=true
Session conflict with servers on the same IP and different ports