php - Session not recognized -


i spent 45 minutes yesterday trying research , troubleshoot this, has idea can try.

it started out 1 of php scripts detecting session $_session empty, stopped executing rest , threw error me.

this entire project has worked on server @ least half year without problems, , no update code or server has been made since then.

here's did then: created new php file testing, made sure there nothing before or after <?php ?> container, , wrote code:

session_start(); var_dump($_session); $_session['test'] = 5; 

then ran file repeatedly, , came empty session.

i had run before, checked folder session files located on server (in case /var/lib/php5), made sure had correct directory owner , permissions, deleted files in , restarted apache. no dice...

i ran file again few times, , each run created new session file, , session file did contain test=5 entry, sessions write correctly.

so checked browser cookies. there , working far can tell - both phpsessid cookie , cookie site creates there. if delete cookies , run test file again, phpsessid cookie recreated , contain same session id created session file.

i added var_dump(session_id()); code right after session_start();, , gave me brand new session id every time script ran.

we're running php version not support session_status() yet, that's not option, either (not sure do, anyway, i'm flying rather blindly here).

so, know sessions created properly, files contain data, cookie contains correct id.

so far can tell, issue must lie either browser not sending cookie data server or server not recognizing session id cookie existing session.

while testing this, firefox wanted install update, ran update, no change. firefox set receive cookies, , did not find exception set anywhere prevent them.

given has been working fine on 6 months, freak accident must have corrupted something, don't know enough linux or internal workings of php , sessions know start diagnosing.

at point did try session_write_close() didn't change (and whole project has been working fine without it).

the thing worked this:

 $c = $_cookie['phpsessid'];  session_name($c);  session_start();  var_dump($_session);  $_session['test'] = 5; 

but use session_start in ton of pages , don't want go through of them enter code shouldn't need in first place...

any thoughts?

thanks in advance!

--- edit ---

i checked issue again, , can confirm cookie name phpsessid instead of phpsessid (thanks pointing out, @cobra_fast), getting closer cause of issue. went php.ini file put value session.name quotation marks, restarted apache, still no change - cookie name still lower case. haven't found antivirus program on computer, , doubt there's network security this... if php settings corrupted @cobra_fast suggested, how fixed? editing file didn't help...

after testing more, found weird thing: 1 client computer affected this! ran code on computer, , worked normally, , session cookies written , read properly. not server acting @ all! have no clue how 1 computer converting cookie names lower case - makes no sense @ all, because happens in 2 browsers... @ least have "fix" situation, , it's out of our hands since said going check computer , re-install if needed. majorly confused right now, @ least it's on :-) responses!


Comments

Popular posts from this blog

how to insert data php javascript mysql with multiple array session 2 -

multithreading - Exception in Application constructor -

windows - CertCreateCertificateContext returns CRYPT_E_ASN1_BADTAG / 8009310b -