php session does not persist -


i have strange situation while trying make site work on bluehost someone. have built simple example illustrate this. have 2 files:

<?php session_start();  $_session['x'] = 'yes';  var_dump($_session); 

and:

<?php  session_start(); var_dump($_session); 

now problem is, when call first file this: array(1) { ["x"]=> string(3) "yes" }

but if after call second file this: array(0) { }

so, session doesn't seem persist between calls. idea might cause this?

the phpinfo session settings are:

session support enabled registered save handlers    files user registered serializer handlers  php php_binary wddx  directive   local value master value session.auto_start  off off session.cache_expire    180 180 session.cache_limiter   nocache nocache session.cookie_domain   no value    no value session.cookie_httponly off off session.cookie_lifetime 0   0 session.cookie_path /   / session.cookie_secure   off off session.entropy_file    no value    no value session.entropy_length  0   0 session.gc_divisor  1000    1000 session.gc_maxlifetime  1440    1440 session.gc_probability  1   1 session.hash_bits_per_character 4   4 session.hash_function   0   0 session.name    phpsessid   phpsessid session.referer_check   no value    no value session.save_handler    files   files session.save_path   /tmp    /tmp session.serialize_handler   php php session.upload_progress.cleanup on  on session.upload_progress.enabled on  on session.upload_progress.freq    1%  1% session.upload_progress.min_freq    1   1 session.upload_progress.name    php_session_upload_progress     php_session_upload_progress session.upload_progress.prefix  upload_progress_    upload_progress_ session.use_cookies on  on session.use_only_cookies    on  on session.use_trans_sid   0   0 

it might others... hosting provider bluehost , after few emails , forth, in blamed development, admitted might because of varnish, have enabled default wordpress optimized packages. https://my.bluehost.com/cgi/help/turn_varnish_off

after turning off, session , cookies seem work


Comments

Popular posts from this blog

html - Outlook 2010 Anchor (url/address/link) -

javascript - Why does running this loop 9 times take 100x longer than running it 8 times? -

Getting gateway time-out Rails app with Nginx + Puma running on Digital Ocean -