| Author |
tomcat session object problem
|
allen catadman
Greenhorn
Joined: Apr 16, 2009
Posts: 7
|
|
test.jsp
<%
session.setAttribute("test","
test");
%>
<a href="testsub.jsp">testsub</a>
testsub.jsp
<%
String test = (String)session.getAttribute("test");
System.out.println("test ->"+test);
%>
-----------------------------------------------------------
working environment : tomcat 5.5/6 or jboss 4.2 / firefox/safari i doubt my apache is also running..
browser 1
1.) hit test.jsp
2.) click testsub link
3.) console output: test->test
4.) close browser
open new browser 2
1.) hit testsub.jsp
2.) console output still: test->test but should be test->null
question: tested in RAD -> OK
1. any setup to server.xml?
expected console output should
test->test
test->null
|
 |
Dawn Charangat
Ranch Hand
Joined: Apr 26, 2007
Posts: 249
|
|
Just a small clarification required :
By opening a new browser, did you mean opening a new tab in the already existing browser ? In that case, the session will be shared.
|
 |
allen catadman
Greenhorn
Joined: Apr 16, 2009
Posts: 7
|
|
|
clicking X of the browser
|
 |
Seetharaman Venkatasamy
Ranch Hand
Joined: Jan 28, 2008
Posts: 5575
|
|
|
you are just closing the browser . it doesnt mean that you are invalidating the session
|
 |
allen catadman
Greenhorn
Joined: Apr 16, 2009
Posts: 7
|
|
yup. but how come it works fine in RAD. the session should not be reuse when i open a new browser...
if thats the case if i login store the user bean into the session.. close the browser, open a new browser access the page i am automatically login because the session is still there?
|
 |
allen catadman
Greenhorn
Joined: Apr 16, 2009
Posts: 7
|
|
i got it.. in mac osx i should command Q not just click X.. at work we use windows/RAD thats why it works.. my mistake i should use command Q totally exit safari/firefox not just click X.. so i still into tomcat..
|
 |
 |
|
|
subject: tomcat session object problem
|
|
|