getravi2k
asked on
Where is "session" stored? is it in the browser or at server..
HI,
I was somewhat confused with the session Object.
From this experiment.
created 2 jsps.
a) test.jsp
b) test1.jsp
In the test.jsp
<%
session.setAttribute("test ", "Ravi");
%>
in the test1.jsp
<%
System.out.print(session.g etAttribut e("test")) ;
%>
So in the first jsp.. you are storing the attribute "test" and in the second jsp you are retrieving and displaying the value.
Now after setting the attribute.. Plz restart the application server.
Now try directly try for the test1.jsp using the same browser.
You will see the value "Ravi" displaying on the console.
I am confused... so i guess the session is stored at the browser side.
Am i correct? or can somebody explain why?
Regs,
Ravindra N
I was somewhat confused with the session Object.
From this experiment.
created 2 jsps.
a) test.jsp
b) test1.jsp
In the test.jsp
<%
session.setAttribute("test
%>
in the test1.jsp
<%
System.out.print(session.g
%>
So in the first jsp.. you are storing the attribute "test" and in the second jsp you are retrieving and displaying the value.
Now after setting the attribute.. Plz restart the application server.
Now try directly try for the test1.jsp using the same browser.
You will see the value "Ravi" displaying on the console.
I am confused... so i guess the session is stored at the browser side.
Am i correct? or can somebody explain why?
Regs,
Ravindra N
Session cookie is stored at client side.
Based on ID from that cookie server retrieves the valuse of session from memory/database etc.
So basically session data is stored at server but session identifier is stored at client.
Based on ID from that cookie server retrieves the valuse of session from memory/database etc.
So basically session data is stored at server but session identifier is stored at client.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Cool. thnx a lot for the clarification.
ASKER