php session variables not updating -
i have php session variable , update in page , access in different page, when variable comes threshold reset 0 , increment according number of files uploaded.
the problem after reaches threshold when reset , reload page again file access session variable not updating , shows 0 though files uploaded.
but session variable incrementing in other page. shows real value(the value incremented) after reloading twice.
i want know why happens.
first of all, critical show codes question, particular one, problem using session
variables
right in file updated them. sessions load before in page so, when update them loaded , although have changed, value still same in current page. prevent that, need either go page after updating session or put redirect after session change statement if necessary stay in same address, this:
<?php if(threshold){ $_session['your_session']='your new value'; header('location sample.php'); } ?>
Comments
Post a Comment