Link to home
Start Free TrialLog in
Avatar of barnarp
barnarp

asked on

JSP Sessions

Hi,

I have been using scripting languages for a while now (ASP,PHP) and have only started learning JSP recently.

I was wondering what all the fuss was about using sessions, as it seems more prominent in all the JSP docs and tutorials.

What can be achieved using sessions that can't be my not using them? ie. what is the advantages and/or disadvantages?

I have seen some of the code, but have no idea how sessions work, and whether I should implement it in an upcoming project?

Also, some tuturial or doc for a beginner might help.

Next Project includes:

- User Login/verifying.
- Oracle 8i database connectivity.



Regards

Pierre
ASKER CERTIFIED SOLUTION
Avatar of Jan Louwerens
Jan Louwerens
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of jodear
jodear

jlouwere is right.

Aside from a session being able to stick with the client (that's why it is called session because it is the client's session with your server, he he he), its other advantages are:

1) storing data in a client's session cannot be seen by anyone compared to storing data in your html forms or in FAT URLs which can be seen when your view source from the browser or blatantly shown in your browsers Address bar.

2) you can store an unlimited amount of data in the client's session object (limited of course by the server's hardware) unlike using FAT URLs which usually can contain less than 500 chars.

Definitely you'd want to use sessions for checking login data of your clients.  Any sensitive or large-size data you want stored or connected to your client's "session" with your server should be stored in sessions.
If you have a large amount if clients, thought, storing large amounts of data n the sesion could result in storage (memory) problems, which in turn could affect site performance. For really large abounts of data, you'd want to store it in a database, or something similiar, and retrieve it upon demand.
And GET URLs are limited to 256 chars (as iodear states), so you can't store much there.
Avatar of barnarp

ASKER

Thanks.

Atleast I now have a starting point!

Regards

Pierre
Avatar of barnarp

ASKER

Thanks.

Atleast I now have a starting point!

Regards

Pierre
barnarp, I noticed there was a problem with the answer (there is still a Proposed Answer, and no real Accepted Answer, although it shows there should be one).
Could you describe to me exactly what happened, from your user perspective, that might have caused that to happen?
Did anything go wrong while accepting the answer? Where you logged out by the system? Any information you provide could help to prevent this from occuring in the future.
Thank you.
Avatar of barnarp

ASKER

sorry,

didn't really notice. I did however think I accept the comment as an answer, but later found out that I just posted a normal comment. I then accepted the answer a second time.

Pierre
No comment has been added lately, so it's time to clean up this TA.

I will leave a recommendation in the Cleanup topic area that this question is:

- points to jlouwere

Please leave any comments here within the
next seven days.

PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER !

girionis
Cleanup Volunteer