Auf Stefans TYPO3 Seite 
(https://www.typo3lexikon.de/typo3-tutorials/ajax/eid-beispiele.html) wird 
beschrieben, wie man mit einer eID einen AJAX-Call im Plugin realisieren kann.

Das funktioniert soweit gut.
Aber leider habe ich dann innerhalb meiner PHP-Klasse die durch den AJAX-Call 
aufgerufen wird keinen Zugriff auf das $GLOBALS Array.

Ich möchte nämlich in $GLOBALS['TSFE']->fe_user mit getKey() und setKey() die 
Session bearbeiten.

Hat jemand eine Idee, wie das geht?

Anbei mal der bisherige Code mit eID:

ext_localconf.php:
..
$GLOBALS['TYPO3_CONF_VARS']['FE']['eID_include'] = 
['KKSoftwareIndexController::storeSession' => 
\KKSoftware\Kksession\Ajax\Session::class . '::storeSession'];
..

Session.php:
<?php
namespace KKSoftware\Kksession\Ajax;

use Psr\Http\Message\ResponseInterface;
use Psr\Http\Message\ServerRequestInterface;
use TYPO3\CMS\Extbase\Utility\DebuggerUtility;

class Session {
        public function storeSession(ServerRequestInterface $request, 
ResponseInterface $response) {
                $response->getBody()->write(json_encode($GLOBALS['TSFE']));
                return $response;
        }
}

session.js:
$().ready(function() {
        $.ajax({
                url: 'index.php',
                method: 'POST',
                data: 'eID=KKSoftwareIndexController::storeSession',
                success: function(result) {
                        console.log(result);
                }
        });
});
_______________________________________________
TYPO3-german mailing list
TYPO3-german@lists.typo3.org
http://lists.typo3.org/cgi-bin/mailman/listinfo/typo3-german

Antwort per Email an