Solved

Javabeans or Cookies

Posted on 2006-07-23
3
561 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

Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

Question has a verified solution.

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

Data breaches are on the rise, and companies are preparing by boosting their cybersecurity budgets. According to the Cybersecurity Market Report (http://www.cybersecurityventures.com/cybersecurity-market-report), worldwide spending on cybersecurity …
Google always has something new and amazing up its sleeve, and the most current thing that they have been working on is another step in the evolution of Google Search, from machine learning to its brilliant successor, deep learning.
This Micro Tutorial will teach you how to censor certain areas of your screen. The example in this video will show a little boy's face being blurred. This will be demonstrated using Adobe Premiere Pro CS6.
This video shows how to use Hyena, from SystemTools Software, to bulk import 100 user accounts from an external text file. View in 1080p for best video quality.

809 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