Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

OnLine Test--Project

 
Sandeep Lodhia
Ranch Hand
Posts: 105
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm working on OnLine test.I need the functionality that if the user gets disconnected,he can continue his test from where he had left after logging again.I've the ID of the user.How to I save his ID on the server for limited amount of time say-1hr.
Please help me.
Sandeep
 
Frank Carver
Sheriff
Posts: 6920
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
There are several ways to do this, depending on whether you prefer the client machine to look after the timing, or the server. If you are using cookie sessions, you can set them to expire after a certain amount of time, so after that time, the client machine won't have your session cookie and will have to log in again.
If you don't want to use cookie sessions, then you can fairly easily attach a "last accessed" timestamp to each user record, and check/update it whenever they submit a page request. If the difference between time now and last accessed time is less than the cutoff period, update the last accessed time to now, and continue. if the time difference is more that the cutoff period, throw away the session and require a new log in.
 
milan doshi
Ranch Hand
Posts: 43
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,
Can Frank or Sandeep please tell me how do you Time Stamp a Record?
I know , that if a session is still valid, one can get the last accessed time , compare it and invalidate the session if required. But how to do this Time Stamping ?
I would really aprreciate the answer with a line or two of the actual code.
Thanx,
Milan
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic