Improve company productivity with a Business Account.Sign Up

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 260
  • Last Modified:

comparing device time with server time

i want to differentiate users device(computers,mobiles) based on device time (accurately down to milliseconds).no two devices will have same time accurately in milliseconds.

javascript can detect device time.
new Date().getTime();

Open in new window


php can generate server time as php timestamp.
date_default_timezone_get();

Open in new window


my logic approach:
-> first detecting user device time though js.
-> sending it to server for comparing with php timestamp
-> after comparing will generate a "difference string" it will be used to differentiate devices.

my approach may be wrong because few seconds will take to pass js var to server.so it will lead to error.

i will be really thankful to him who will solve this issue.
0
chrisvee
Asked:
chrisvee
  • 4
  • 3
1 Solution
 
ScorchDCommented:
If you could explain why you are trying to identify the devices it may help establish a more elegant solution.
0
 
chrisveeAuthor Commented:
@scorchD i am trying to detect users device uniquely.  already i developed a solution to detect devices using many data points. now  i want to add this one to my system for accuracy.
0
 
ScorchDCommented:
Once you have given that device a unique ID how are you going to ensure that id stays with that device in the future? Or are you simply dropping that ID when the device leaves.
0
Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

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.

 
ScorchDCommented:
Sorry reading back I think understand your approach theory now.
0
 
ScorchDCommented:
I don't think you can reliably predict the time difference between what is a server side and client side behaviors, both functions will return the value you are looking for but the time between them being triggered is not guaranteed consistent which is your obstacle.

This may be of interest to you.
http://faculty.csie.ntust.edu.tw/~weichung/documents/AINA2012.pdf
0
 
chrisveeAuthor Commented:
@scorchD  it will be great if you help me how to implement clock-skew based device fingerprinting.
0
 
chrisveeAuthor Commented:
@scorchD  also check this link http://noc.to   it collecting 'client timestamp' and 'server timestamp'. we can subtract and send that difference to server.
0
 
Ray PaseurCommented:
Please see "Practical Applcation #8" in this article.  It contains an example that may be helpful to you.
http://www.experts-exchange.com/Web_Development/Web_Languages-Standards/PHP/A_201-Handling-date-and-time-in-PHP-and-MySQL.html
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Upgrade your Question Security!

Your question, your audience. Choose who sees your identity—and your question—with question security.

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