javascript - Session not working on new server -
i have site changes whenever new location changed. location choices using drop down. , on change calls function:
function prod_change_loc() { location_change = document.getelementbyid("prod_sel_loc").value; varurl = "http://" + varserveraddr + "/hourly_ft_wip/production_line/prod_line_loc.php?location_change=" + location_change, load(varurl, "location"); settimeout(function() { location.reload(); }, 100); }
prod_line_loc.php contains:
session_start(); $_session['hourly_ft_wip']['prod_loc'] = $_request['location_change']; $_session['hourly_ft_wip']['prod_tester'] = 'all';
and returns main page sets location using this:
if(!isset($_session['hourly_ft_wip']['prod_loc'])){ $_session['hourly_ft_wip']['prod_loc'] = 'eolphl'; } else{ $_session['hourly_ft_wip']['prod_loc'] = $_session['hourly_ft_wip']['prod_loc']; }
this working in our server, had transfer new server , session changed. doesn't. there settings might affect this?
the difference see in them in our old server located in var/www/folder
in our new server located in var/www/html/folder
also reason have sleep function doesn't work in firefox without that.
as stated:
session_start();
needs on every php page; in cases embedding ajax calls needs on ajax/php pages.
you can use:
session_name();
if want make sure using same session
you can use database storage sessions may fit more within means.
as edit:
if(!isset($_session)) { session_start(); }
this should on every page. if session has been started wont come error if not start. way wont lose session between pages.
Comments
Post a Comment