Topic-icon Joomla how to disable cookies for normal user

  • naaux
  • naaux's Avatar Topic Author
  • Offline
  • Moderator
  • Moderator
  • Every solution breeds new problems.
More
1 year 11 months ago - 1 year 11 months ago #1 by naaux
Anleitung:
stackoverflow.com/questions/43869982/how...ookies-in-joomla-3-x

You must edit two files /libraries/src/Application/CMSApplication.php and libraries/joomla/session/handler/native.php

In libraries/src/Application/CMSApplication.php change code around line 166 and add if condition for whole code in method if (substr($_SERVER , 0 , 14) == "/administrator"){

public function checkSession()
    {
      if (substr($_SERVER['SCRIPT_NAME'] , 0 , 14) == "/administrator"){ // added condition
        $db = \JFactory::getDbo();
        $session = \JFactory::getSession();
        $user = \JFactory::getUser();

            // ... rest of code
      }
}
In libraries/joomla/session/handler/native.php change code around line 229 add if condition for whole code in method like in previous file
private function doSessionStart()
    {
      if (substr($_SERVER['SCRIPT_NAME'] , 0 , 14) == "/administrator"){ // added condition
        // Register our function as shutdown method, so we can manipulate it
        register_shutdown_function(array($this, 'save'));

        // ... rest of code
      }
 }
This works in Joomla 3.8.2


What is best in life?
"To crush your enemies, see them driven before you, and to hear the lamentation of the women! "

Fragen richtig stellen
Last edit: 1 year 11 months ago by naaux.

Please Log in to join the conversation.

Moderators: naaux