I
I
Igor2018-05-14 07:08:17
Web development
Igor, 2018-05-14 07:08:17

How to weed out some users on this basis?

Good afternoon. An unusual situation has arisen. Suppose there is a page on the Internet, which, of course, freely opens at the address through the browser. These will be the so-called "browser" visitors, but there are two more categories: those who open the page in the Cordova mobile web app, and those who open the page through the NodeWebkit Windows app. I need to block the display of the page only for those who open through the browser, that is, I need it to work only through application data (which, in fact, are browsers too ...). How to implement this? And is it even possible? Is it possible to somehow distinguish user data (maybe using PHP, .htaccess)? Thank you.

Answer the question

In order to leave comments, you need to log in

3 answer(s)
M
mletov, 2018-05-14
@stepigor

php $_SERVER["USER_AGENT"]
PS The main thing is that the target applications are not disguised as regular browsers

D
Dmitry, 2018-05-14
@demon416nds

cookies in the application as an option

�
✭☭, 2018-05-14
@Yertuwernat

Send the page as a string in response to a client's ajax request.
That is, store the page on the server not as an html document, but as a txt file.
On the client, insert this line into the srcdoc of the iframe or the innerHTML div.
Then the robots will not see this page

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question