File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Web Component Certification (SCWCD/OCPJWCD) and the fly likes Need help in Maintaining Seesion. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Soft Skills this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Certification » Web Component Certification (SCWCD/OCPJWCD)
Bookmark "Need help in Maintaining Seesion." Watch "Need help in Maintaining Seesion." New topic
Author

Need help in Maintaining Seesion.

Suchen Chodankar
Ranch Hand

Joined: Sep 18, 2006
Posts: 47
Hi all,
I am developing a small web app.
Now to maintain the session of the user I have followed the following steps and I would like to know whether I am right in doing this.

1. when user logs in to the system I fetch user information from the database and set it to the UserInfo object( called userInfo. UserInfo stores the information about any user.

2. Now I set this UserInfo object to the session attribute called userInfo as shown below.:


3. Now everytime the request comes from that particular user I make sure that the session is not new and the session attribute "userInfo" as mentioned in step 2 exists in that particular session.

Now my questions are:
Is this the correct way to manage sessions in the real applications?
Is there anything else I need to do to make sure session does it's work properly?


Thanks in advance.
Christophe Verré
Sheriff

Joined: Nov 24, 2005
Posts: 14688
    
  16

3. Now everytime the request comes from that particular user I make sure that the session is not new and the session attribute "userInfo" as mentioned in step 2 exists in that particular session.


Are you using filters ?


[My Blog]
All roads lead to JavaRanch
Suchen Chodankar
Ranch Hand

Joined: Sep 18, 2006
Posts: 47
no I have not used any filters.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Need help in Maintaining Seesion.