Inscrivez-vous ou connectez-vous pour rejoindre votre communauté professionnelle.
is it possible to create session using client side programming , using JavaScript only?
Yes, the browser can store variables, even with jquery
Technologies are now evolving, actually you can save a session for client side using
HTML Local Storage Objectsalso you can save a session in Cookies by using javascript
No, but you can make an AJAX request to PHP to set one.
No, but you can make an AJAX request to PHP to set one.
For example:
Javascript file:
var xmlhttp =newXMLHttpRequest(); xmlhttp.open("GET","session_maker.php",true); xmlhttp.onreadystatechange =function(){if(xmlhttp.readyState ==4&& xmlhttp.status ==200){ alert("Done! Session created.");}};PHP File:
<?php session_start(); $_SESSION['mySession']=1;?>