i have a standalone application from which using the httpclient i'm communicating with the another web application for user authentication and set the user details in session in the web application and after returning to the standalone application i have some logic to run and afterwards i'm forwarding to the web application success page (here in the success page i am unable to retrieve the session where m getting the session object value null.. ) . So how do i preserve the session ?
Asked
Active
Viewed 180 times
1 Answers
0
Sessions are only available at the web application and the client browser!
So you need to ask the admins or find a public API how to get it, because you can't reach it from a remote machine directly.
The clients just save the id of the session within a cookie, don't store data locally, everything what you need is on the web application's scope.

Eru
- 187
- 4
-
yes u r right.. my situation is i have app1 from which m communicating with app2 action class and therein action class i'm setting the session and adding cookie with sessionid and returns back to app1 class and does rest of the logic and forwards to the app2 jsp page where m getting back the session of the session already set during the communication as null...so is there anyway that i can maintain session for my scenario? plzz help me!! – raghavendra Nov 15 '12 at 06:16
-
you can transfere the session data between the apps by encode the whole to a JSON string (for example), then send through the web with cURL. You can use authentication at the referer string, a secret key or something to prevent others to communicate in this channel from outside your scope, then just simply decode the string to an array and you can use your own logic. GZipping the content before sending it should be a good idea, because the bandwith and communication speed. HOPE HELPED - :) – Eru Nov 17 '12 at 22:24