A] Is the response.sendRedirect ends the existing session?B] If I logged in to a site ( say a.com) & then in same browser window I type the url for another site (say b.com), then does my session gets ended on first site ( a. com ) ?

Showing Answers 1 - 9 of 9 Answers

shanthini

  • Mar 22nd, 2006
 

yes whenever the send.redirect passes to the webcontainer, the control passed to the new site, new session will be initiated.

The same this happens in the browser, when u include a new URL, the control goes to new site, the new session will be opened the older session will be invaildated and thus termiate the thread.

  Was this answer useful?  Yes

Ranjan

  • Apr 6th, 2006
 

If u r using same browser and going from a.com to b.com .

Both sesssion are retained by browser untill unless session do not times out.

I just tried gmail.com to yahoo.com and it works in single browser

  Was this answer useful?  Yes

Yes, Ranjan is right. i have also seen the same.

Think when a website using Credit Card validation, it sends data to another site to validate the number and all stuffs of credit card if it is validated successfully one can buy or do something. Then if his session is invalidated then how server knows who is the owner of that credit card which is just validated.

  Was this answer useful?  Yes

prabhaker

  • May 19th, 2006
 

by using the send redirect i think the sesssion should expire.

Because there is no session objects are available for redirected page.

and no request or response objects are availble. 

if write the code in the redirected page like

<%=request.getParameter("")%>;it will print null.

for sending a page to out of scope only we are using redirect otherwise u can use forward()method.

  Was this answer useful?  Yes

geetha

  • Jun 12th, 2006
 

 I think they told i.e Shanthini and prabhakar is correct

  Was this answer useful?  Yes

Srikanth

  • Nov 9th, 2006
 

wht i think is session will not expire but only the previous response object will be close and a fresh new response object will be sent to it

  Was this answer useful?  Yes

charankk

  • Apr 30th, 2008
 

Hi
Prasanth, The case is differnt here.
Assume you have opened gmail.com and logged in... session will be created.
Then you have tried to replace the url as yahoo.com, here the browser will identify the request as new and will get the response from yahoo server but not from google server. Both are entirely different servers.
google container still have your seesion which is not yet invalidated. So you can access the same session. Because we are not intimated to invalide session to container by using logout or etc


If you have some links in gmail account that trasfers the control to other site, assume yahoo, gmail developer used sendredirect function to redirect the request.Here we are calling sendredirect method. It will invalides the session object before sending the request to yahoo.

I hope you get an some idea.

regards
Pavan

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions