uguMark
uguMark

Reputation: 611

Way to know that user got to URL directly through QR scan?

I'm building a web based app that works with QR codes. Is there any way to know that when a user lands on a URL that the user came directly from a scanned QR code? Instead of going directly to the URL? I don't want the user to be able to go back to that same URL a few days later and refresh a couple of times without doing new scans. I realise this is a long shot and I know building a custom QR scanning app might be the only way but just seeing if anyone has any ideas?

Upvotes: 1

Views: 1583

Answers (2)

Sean Owen
Sean Owen

Reputation: 66881

No there's no way to do this in a seriously secure way. I suppose you could create a custom application that scans, then performs some secure logic that the user can't tamper with. Aside from that, any mechanism that relies on the browser to open URL X can be triggered by the user just entering X. There's no difference from your server-side perspective.

Upvotes: 0

Mark Bertenshaw
Mark Bertenshaw

Reputation: 5689

I suppose that you could add a value to the url's query string indicating it is from a QR link, e.g.

http://myserver/mypage.php?QR=1

You would have the page automatically redirect (meta refresh, whatever) to:

http://myserver/mypage.php

But by this time, you would have associated this session with a QR code being used. Hopefully, the user won't have noticed this sleight of hand, and would be left with the browser only showing the second URL. Only if the user went back to the QR scanning app would s/he realise what would have happened.

Upvotes: 2

Related Questions