mirror of
https://github.com/DanielnetoDotCom/YouPHPTube
synced 2025-10-05 19:42:38 +02:00
Updates
This commit is contained in:
parent
3c5ebfcba5
commit
bc81ceb9ec
7 changed files with 63 additions and 74 deletions
23
view/js/session.js
Normal file
23
view/js/session.js
Normal file
|
@ -0,0 +1,23 @@
|
|||
// Create a variable to hold the session ID
|
||||
var PHPSESSID = null;
|
||||
|
||||
// Function to load the session ID via AJAX
|
||||
function loadPHPSessionID() {
|
||||
fetch(webSiteRootURL + 'objects/phpsessionid.json.php', {
|
||||
method: 'GET',
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
'Cache-Control': 'no-cache'
|
||||
}
|
||||
})
|
||||
.then(response => response.json())
|
||||
.then(data => {
|
||||
PHPSESSID = data.phpsessid; // Assign the session ID to the variable
|
||||
console.log('PHPSESSID loaded:', PHPSESSID); // You can remove this in production
|
||||
})
|
||||
.catch(error => {
|
||||
console.error('Error loading PHPSESSID:', error);
|
||||
});
|
||||
}
|
||||
// Load the session ID as fast as possible
|
||||
window.addEventListener('DOMContentLoaded', loadPHPSessionID);
|
Loading…
Add table
Add a link
Reference in a new issue