There is a problem with session variables in my web-application. I have several types of documents, when users want to edit it , Then it pushes a document and PHP record number document at $ _SESSION ['patent_number'] through the GET method launch application when all ok I test with 2 documents with 2 different numbers. All the work is okay to start, but then it seems that the session variable has not changed and I see the document with another number.
When a user clicks on the "edit" button, he sends a document number for patent_load.php, and it is always loading correctly:
Var patent_number = $ (this) .val (); . $ ('# User_input_text') Load ('pages / patent / patent_load.php section = patent_claims & amp; PATENT_NUMBER =' + PATENT_NUMBER);
But when I click on the section of the document from the menu, the old session number appears:
$ ('# user_input_text'). Load ('? Pages / patent / patent_load.php section = patent_claims');
Here is a patent_load.php:
session_start (); Session_regenerate_id (); If (isset ($ _ session ['id'])) {$ db = new mysqli ('x', 'x', 'x', 'x'); $ Db-> Set_charset ("UTF8"); $ Section = $ _ received ['section']; If (isset ($ _GET ['patent_number'])) {$ number = $ _ GET ['patent_number']; $ _SESSION ['PATENT_NUMBER'] = $ number; The echo is 'Go Set'; } $ Patent_number = $ _ session ['patent_number']; $ Query = "Select $ from new_patent_document section where patent_number = '$ patent_number'"; $ Result = $ db- & gt; Query ($ query); $ Line = $ result-> Fetch_assoc (); Echo $ patent_number. ','; $ Line [$ section] echo;
Any ideas how I can solve it and why session variables are not updated. thank you in advanced.
Check if the browser receives the requests you received. I do not know how your app is designed, but if you use the "back" button from the browser (or via javascript) you will face this situation.
Comments
Post a Comment