Solved

Javabeans or Cookies

Posted on 2006-07-23
3
558 Views
Last Modified: 2012-08-13
Hi guys

I am mocking up a system with jsp pages and servlets (including Javabean classes) and SQL Server.  I am following the 3 teir design pattern, using jsps for the interface, serlvets for processing, and javabeans to hold information during the user's session.

I am a bit confused as to whether I need to use cookies.

So far I have used a Javabean instance to set information about the user that has logged in, so that I can use that information throughout the user's session.  For example, I can use the Javabean that has been set, to get the user's names, staff id, region and so forth.  So it seems to me when I want to know who the user is, I just need to get those properties from the java bean.

Do I need to consider using cookies, or will the fact that I am using Javabeans (not enterprise Javabeans) suffice?

Phil
0
Comment
Question by:pmccar06
3 Comments
 
LVL 4

Assisted Solution

by:pzepernick
pzepernick earned 65 total points
ID: 17162966
I would stick with your javabean / session implementation.  The only thing I usually store in a cookie is the user name they typed on the login page.  This way next time they come back I populate the user name for them.  

Paul
0
 
LVL 29

Accepted Solution

by:
bloodredsun earned 60 total points
ID: 17171070
As above, javabeans in the session will suffice.

Only use cookies if you have non-secure data that you want to persist over a number of visits, such as auto-login as this site uses. As the session is not sent to the user, it is far more secure so infomation like userid and password should never be set in the cookie.

Persistence of form information is also somehting that I would store in the sessions. For example, this is used in Struts for returning to the form when the entries have failed validation.
0
 

Author Comment

by:pmccar06
ID: 17173800
Hi guys

Thanks for your help.  Much appreciated.

Cheers Phil
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Short answer to this question: there is no effective WiFi manager in iOS devices as seen in Windows WiFi or Macbook OSx WiFi management, but this article will try and provide some amicable solutions to better suite your needs.
A Short Story about the Best File Recovery Software – Acronis True Image 2017
Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

746 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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now