From jquery, I send to validate a user via Ajax, validation that is in a PHP. If the validation is Ok, the PHP puts the user in a session variable:
<?php
$_SESSION['nombre']=$usuario;
Then, I print said variable in the html:
<div>
<?php echo "Usuario Logueado:[".$_SESSION['nombre']." ]";?>
</div>
Finally, from jquery via Ajax, I send information to record in mysql in another PHP. From this PHP, I try to access the session variable to record the user, but does not recognize it;
<?php
require_once ("funciones/conexiones.php");
$ven=$_SESSION['nombre'];
Reviewing in the console, throws:
Notice: Undefined variable: _SESSION
Why can not I access the value stored in the variable _SESSION?
Since now, thank you very much for the help.
Additionally, I tried to print the session variable in the jquery:
$(document).on('change', '.cmb_articulo', function ()
{
alert($_SESSION['nombre']);
but it throws me: ReferenceError: $ _SESSION is not defined
Thank you.