0

i was just curious that is it possible to restrict some users to only allow login in our panel from particular devices only .

I was finding some details from $_SERVER and i got this


Array
(
    [USER] => instantpay
    [HOME] => /Users/instantpay
    [HTTP_SEC_FETCH_USER] => ?1
    [HTTP_SEC_FETCH_SITE] => same-origin
    [HTTP_SEC_FETCH_MODE] => navigate
    [HTTP_SEC_FETCH_DEST] => document
    [HTTP_UPGRADE_INSECURE_REQUESTS] => 1
    [HTTP_COOKIE] => ci_session=qk33mhf5a33i6b9gqa2p7pb2rdv25gtt
    [HTTP_REFERER] => http://matri.localhost/admin/home
    [HTTP_CONNECTION] => keep-alive
    [HTTP_DNT] => 1
    [HTTP_ACCEPT_ENCODING] => gzip, deflate, br
    [HTTP_ACCEPT_LANGUAGE] => en-GB,en;q=0.5
    [HTTP_ACCEPT] => text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,*/*;q=0.8
    [HTTP_USER_AGENT] => Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:104.0) Gecko/20100101 Firefox/104.0
    [HTTP_HOST] => matri.localhost
    [REDIRECT_STATUS] => 200
    [SERVER_NAME] => matri.localhost
    [SERVER_PORT] => 80
    [SERVER_ADDR] => 127.0.0.1
    [REMOTE_PORT] => 57976
    [REMOTE_ADDR] => 127.0.0.1
    [SERVER_SOFTWARE] => nginx/1.21.4
    [GATEWAY_INTERFACE] => CGI/1.1
    [REQUEST_SCHEME] => http
    [SERVER_PROTOCOL] => HTTP/1.1
    [DOCUMENT_ROOT] => /var/www/matrimonial
    [DOCUMENT_URI] => /index.php
    [REQUEST_URI] => /admin/add-client
    [SCRIPT_NAME] => /index.php
    [CONTENT_LENGTH] => 
    [CONTENT_TYPE] => 
    [REQUEST_METHOD] => GET
    [QUERY_STRING] => 
    [SCRIPT_FILENAME] => /var/www/matrimonial/index.php
    [FCGI_ROLE] => RESPONDER
    [PHP_SELF] => /index.php
    [REQUEST_TIME_FLOAT] => 1663224155.1239
    [REQUEST_TIME] => 1663224155
)

except remote address, is there any way or any other methods by which i would be able to find out whether my request is from which device ?

Or any unique device id kind of thing

Thanks !!

Rohannn Singh
  • 56
  • 1
  • 7

0 Answers0