• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Session Manager

 
Atul Darne
Ranch Hand
Posts: 118
Java Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hello ranchers

i need to implement my on Session manager for a small transaction application; which should track sessions and kick if user is idle , and all this should be managed by my API, can i get some ready made code from websites, please refer some codes and ideas , how should i begin.
 
Devaka Cooray
ExamLab Creator
Marshal
Pie
Posts: 4680
329
Chrome Eclipse IDE Google App Engine IntelliJ IDE jQuery Postgres Database Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Atul Darne wrote:can i get some ready made code from websites, please refer some codes.....

No! That's not how JavaRanch works. Please read NotACodeMill.
Considering your requirement, why do you need having your own session manager, since the session management is done by the container?
 
Deepak Bala
Bartender
Posts: 6663
5
Firefox Browser Linux MyEclipse IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
can i get some ready made code


Sure. I charge 120 $ / hour

which should track sessions


Lookup HttpSession. The container already does this for you like Devaka suggested
 
Malatesh Karabisti
Ranch Hand
Posts: 153
Java Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Atul,

Normally it is the job of the container to take care about the session. when the client visits your application first time contanier creates a unique id for that particualr client called as session Id. and this Id is used to bind between the client and the sesssion object. the session id is exchanged between client and the server in two ways

1)Cookies
Cookies are made to hold the session id, It is the containers which uses the cookies to bind between session object and particular client. that means when the container receives first request from the client then in the response, session id will be added and this session id will be saved in the cookies in the client machine. then in the next request from the client. the browser adds the cookies in the request before submitting the request to the server. Again the cycle repeats container finds the session id in the cookie and binding happens between session object and the client.

2)Url Rewriting
Just look for HttpServletResponse Api you will get idea, two methods are there in this interface to help Url Rewriting

when you say session expired that means the "session" object is deleted by the container.
 
Atul Darne
Ranch Hand
Posts: 118
Java Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thankyou Malatesh , iam going through the material you provided.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic