Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

JSP Sessions

Posted on 2002-04-17
9
Medium Priority
?
281 Views
Last Modified: 2010-03-31
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
0
Comment
Question by:barnarp
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
9 Comments
 
LVL 5

Accepted Solution

by:
Jan Louwerens earned 200 total points
ID: 6949314
A session is an object that stays with a client the whole time they're on your site. You can store information in the session that is associated with a client.
For example, once a client logs in to your website, you can store the client's login name (or any info uniquely identifying the client: ID, email address, etc) inside the session and will stay with that client until you invalidate it from with your code, or the user closes the browser.
0
 

Expert Comment

by:jodear
ID: 6949821
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.
0
 
LVL 5

Expert Comment

by:Jan Louwerens
ID: 6951266
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.
0
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 

Author Comment

by:barnarp
ID: 6951580
Thanks.

Atleast I now have a starting point!

Regards

Pierre
0
 

Author Comment

by:barnarp
ID: 6951581
Thanks.

Atleast I now have a starting point!

Regards

Pierre
0
 
LVL 1

Expert Comment

by:Jan Louwerens
ID: 6951692
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.
0
 

Author Comment

by:barnarp
ID: 6958920
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
0
 
LVL 35

Expert Comment

by:girionis
ID: 8682523
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
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

By the end of 1980s, object oriented programming using languages like C++, Simula69 and ObjectPascal gained momentum. It looked like programmers finally found the perfect language. C++ successfully combined the object oriented principles of Simula w…
Introduction This article is the first of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article explains our test automation goals. Then rationale is given for the tools we use to a…
The viewer will learn how to implement Singleton Design Pattern in Java.
This tutorial will introduce the viewer to VisualVM for the Java platform application. This video explains an example program and covers the Overview, Monitor, and Heap Dump tabs.
Suggested Courses

604 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question