The following warnings occurred:
Warning [2] Undefined variable $unreadreports - Line: 26 - File: global.php(961) : eval()'d code PHP 8.1.2-1ubuntu2.14 (Linux)
File Line Function
/global.php(961) : eval()'d code 26 errorHandler->error
/global.php 961 eval
/printthread.php 16 require_once



UserSpice
AJAX and User ID and Token - Printable Version

+- UserSpice (https://userspice.com/forums)
+-- Forum: Support Center (https://userspice.com/forums/forumdisplay.php?fid=23)
+--- Forum: UserSpice 4.3 and Below (https://userspice.com/forums/forumdisplay.php?fid=26)
+--- Thread: AJAX and User ID and Token (/showthread.php?tid=522)



AJAX and User ID and Token - Popkultur - 04-11-2017

Hello!

First, I'd like to say thank you for developing this.

I want to make an ajax call on a user restricted page. I set the target to the same php page and put the php code which handles the ajax call directly after the init script, but before header and navigation.

The Problem is, I need to tell the User ID within the ajax called php-handler. But since it is an ajax call, the user ID is not available (user token not submitted). Would it be safe to just submit the token within the ajax call? And if so, how do I get the token?

Thanks for advice!