PHP session after Load()

Asked

Viewed 48 times

0

I’m facing a little problem regarding my session..

When I reload the page by the function load(), my session does not update and the message is displayed

Notice: Undefined variable: _SESSION

From what I understand, using the load(), session data is lost.

Is there any way to solve this problem?

 $(".editoraview h1").click(function(event) {
        $.ajax({
          url: 'classes/consulta.php',
          success : function(txt){
            $('#view-full').load('classes/consulta.php');
          },
          error: function(result) {
            alert("Erro");
          }
        });
    });

Thank you =D

2 answers

4

In php you need to start a new session before using session variables, so call:

session_start();

Before using $_SESSION.

If this is not the case then edit the question by placing the php file code so we can help you.

0

just give a <?php session_start()?> on the page being loaded by load()

Browser other questions tagged

You are not signed in. Login or sign up in order to post.