mardi 14 août 2018

Other session in PHP aplication

I have a strange problem with the session... I created the MVC php app with redirection in htaccess.

RewriteEngine On
RewriteCond %{HTTP_HOST} ^(www\.)?domain\.com$ [NC]
RewriteCond %{REQUEST_FILENAME} !/Public/
RewriteRule ^(.*)$ /Public/$1 [L]

and htaccess in Public dir:

Options -MultiViews
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.+)$ index.php?url=$1 [QSA,L]

In default api index.php (url: domain.com/offer or domain.com/gallery) session work normally

<?php print_r($_SESSION); ?>
//result: ARRAY ( [TEST] => TRUE )

<?=session_id()?>
//result: 6a5d103581340500d75b76c47f335d4e

BUT! if i use a url: domain.com/ajaxFilePHP/signIn.php session doesn't work correctly...

<?php print_r($_SESSION); ?>
//result: Array( [IL] => 1 [NAME] => admin [LID] => 1 )

<?=session_id()?>
//result: 

I checked that the ajax and client connection is the same.

Its not my server... in my PC and in my server, api work correctly... session configuration in php ini is almost identical...

My server:

Cookie - PHPSESSID=....
HTTP_COOKIE - PHPSESSID=...

session.cookie_httponly - no value
session.gc_divisor  - 1000
session.sid_bits_per_character - 5
session.sid_length - 26

other server:

Cookie - no entry in ini
HTTP_COOKIE - no entry in ini

session.cookie_httponly - 0
session.gc_divisor  - 100
session.sid_bits_per_character - 4
session.sid_length - 32

someone can help?




Aucun commentaire:

Enregistrer un commentaire