Solved

Javabeans or Cookies

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

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
session bean client machine 9 69
servlet cookie finding by name 1 96
error when compiling my project in eclipse luna 30 544
running on tomcat not jboss eap 7.0 3 55
After hours on line I found a solution which pointed to the inherited Active Directory permissions . You have to give/allow permissions to the "Exchange trusted subsystem" for the user in the Active Directory...
Deploying our service is a grudge match between customer benefits and customer pain. In one corner, rolling out fixes (yay!) and delivering new features (double yay!). In the other corner, training on new features (boo – sounds like work), and chan…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …
Are you ready to implement Active Directory best practices without reading 300+ pages? You're in luck. In this webinar hosted by Skyport Systems, you gain insight into Microsoft's latest comprehensive guide, with tips on the best and easiest way…
Suggested Courses

751 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