If i am logged into a site say (abc.com) then my session will be created. and in the middle i type the same URL in the same browser window. So that means my new session will be created or the it will return me the existing session. and how it has been done?

Questions by enayatshaikh

Showing Answers 1 - 1 of 1 Answers

<html>

<head>

<title>

current page

</title>

</head>

<body>

<%session=request.getSession(true);%>

<%Integer acesscount=(Integer)session.getAttribute("acesscount");%>

<%String temp=null;%>

<%if(acesscount==null)

{

temp="welcome to our site";

acesscount=new Integer(0);

}

else

{

temp="welcome back to the site";

}

%>

<%session.setAttribute("acesscount",new Integer(acesscount().getValue()+1);%>

The no of times u acess is:<%=session.getAttribute("acesscount");%>

</body>

</html>

  Was this answer useful?  Yes

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