Two Laptop Bag*
The moose likes Struts and the fly likes Reading cookie value Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Reading cookie value" Watch "Reading cookie value" New topic
Author

Reading cookie value

amitabh pandey
Greenhorn

Joined: Mar 16, 2012
Posts: 9
Hi i am facing some proble in reading cookie

I have two application in struts in which i have to use SSO for reading data from cookie .I have done in both application but one is working fine but another not.
This is the step which i have follow.
1-In login action class which is my first login class i read that if userid form bean value is null then read data from cookie.
cookie is reading data and then i have set that cookie value in userid form bean and then next process is smae as previous.

means it reads data from userid form bean and validate user by database.

and after validation i set this id in session.

after this on each page it reads data from session.

this is working fine.

but in second application i have follow the same steps cookie is reading data and it set in session but when my home page open and i click any menu to open page then it read data userid from session but here it comes null when i check that session is new or old by isNew() method then it returns true means it is a new session means session is not set. But why it is happning this problem comes when i read data from cookie .
Any one please tell me why this problem is comming
It's urgent

Regards
Amitabh
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Reading cookie value
 
Similar Threads
Session Management
Struts2-json plugin not serializing action class to json
session issue with multi tabs in a browser
Cannot find Bean formBeanUser in scope null
EJB 2.1 - Database connection for multiple users in Entity Bean (BMP)