I
I
Ioldyz2015-09-27 13:09:43
PHP
Ioldyz, 2015-09-27 13:09:43

PHP, Google Chrome, session values ​​are always different, what am I doing wrong?

Good afternoon!

So, in index.php , the first lines

session_start();
$sid = session_id();

in the same file I need to save the generated array to the session, I do this
$_SESSION[$sid] = $t->getData(); #$t->getData(); генерирует всегда разный массив

Sending ajax data to check.php file
.ajax({type:"POST",url:"check.php",data:{t:t,"sid":"<?=$sid;?>"},success:function(t){ // и т.д.


in the check.php file I write the following
echo '<pre>';
print_r($_SESSION);die;


and I see that the array $_SESSION[$sid] in index.php and in check.php is constantly different, as if it is always generated in check.php, although there is no such thing, is it a feature or do I have a bug?)

I checked Firefox and IE, there everything is fine, what could be the reason

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Dmitry Kim, 2015-09-28
@kimono

Are you not starting the session in the check.php file?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question