bhusan we had the same problem and as craifg stated it is better to use
hidden variables instead of passing the session. as you are aware http
request span across single request.
if you feel that passing as query string has some limitations, you can pass
as POST method and you can use
httputils.parseQueryString method to get all the params as name value pairs
in an hashtable.
Regards
Ramesh Kesavanarayanan
Electronic Data Systems
Steeple Reach,
25, Cathedral Road,
91-44-811 3801 to 15 ext :2186
91-44-233 0380 (res)
[EMAIL PROTECTED]
[EMAIL PROTECTED]
-----Original Message-----
From: Craig R. McClanahan [mailto:[EMAIL PROTECTED]]
Sent: Thursday, January 04, 2001 8:04 AM
To: [EMAIL PROTECTED]
Subject: Re: Losing session in redirection
Bhushan Bhangale wrote:
> Hi All
>
> In my web-application i redirect request to another site, then it again
redirects me back to another URL on my server.
>
> What happens is that when before i , redirect to the other site, i have a
session (session A). When the script at the other site redirects me back to
my server. The server creates another session (session B) for me. This way
the earlier session (session A)also exists on the server for some specified
interval of time. I end up loosing my session (session A) related
information (in session B).
>
> If i want to maintain the same session (session A) - i pass the 'session
id' ( session A's session ID) as a parameter to the other site. The other
site redirects me to my site with the 'session id' ( session A) as a
URL-parameter.
> When it redirects me to my site i process the request (inside session B)
for getting the same session (session A).
> This works fine.
>
> The only problem here is that i end up creating another session ( session
B)!
>
> Is there any solution to avoid this creation of another session ?
>
Not using standard servlet sessions.
Per the servlet specification, the scope of a session is a single webapp.
When you go to another site (or even another webapp on the same site), you
are outside the scope of the original webapp, so any session you create here
will be a new one (with its own session id).
To share information between webapps on different servers, the most common
techniques are:
* Create your own cookies (where you can control the "domain"
and "path" properties)
* Include needed information as hidden form variables
* Include needed information as query parameters in the
redirect URL.
>
> Thanks & Regards
> Bhushan Bhangale
>
Craig McClanahan
___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".
Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html
___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".
Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html