• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 175
  • Last Modified:

session tracking

I have read two books on session tracking. It simply says it has four steps
create session object
setAttribute
getattribute
close session

My doubt is I am not knowing how to track session using this input type is hidden. If anyone could show me how to track session for three different pages i.e carrying data from page one to page two and add some more data of page 2 to that of page three and carry from page two to page three.
0
rmvprasad
Asked:
rmvprasad
  • 2
1 Solution
 
ManishLeadCommented:
Hi,
1.   You can carry data from page 1 to page 2 , u can access page 1 values in page 2 by request and store it in hidden , again after submitting second form , u will get values in page 3.
  2. If you want to use session object,set value in session.setAttribute in page 1 and
get that attribute in page 3 direct by session.getAttribue,

karan.
0
 
a122178Commented:
You can set the name of the session value by

session.setAttribute("page1", value);
session.setAttribute("page2", value);
session.setAttribute("page3", value);

How about that?
0
 
rmvprasadAuthor Commented:
I know that it is create session object, setattribute, getattribute and finally close the session object. But i am not able to do in code. I will be really pleased and thankful if you could show a small some sample code
0
 
ManishLeadCommented:
<%@ page session="true" %>
<%
 session.setAttribute("Param1","Value");
%>


to get
<%
 String value=(String)session.getAttribute("Param1");
%>

Hope this helps.
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now