[RSS Feed/News] Recognize a visitor (guest or logged in) via a hash

Status
Not open for further replies.

XenForo

Administrative
  • Thread starter
  • Admin
  • #1
I'm looking for a variable (maybe a hash like md5), accessable via the \XF::app()-> or \XF::visitor()-> / or/ and something like session to use it.
I need this hash to be static based on IP and User Agent and so on for guests and logged in users.

For example, I could add this on User Entity:
PHP:

Code:
    public function getVisitorHash()
    {
        $ipAddress = \XF::app()->request->getIp();
      
        // with some salt
        return md5($ipAddress . $_SERVER['HTTP_USER_AGENT'] ...

Read more

ادامه مطلب...
 
Status
Not open for further replies.
Back
Top Bottom