Saving Parameters on the Flash of ESP32S3

Hello,
i am working on a project which i should be able to update the firmware over the Ethernet.
THis issue is already successfully done.
Now i am able to change the IP-Address, Subnet mask and Gateway and store them on the Flash. What i am now trying to do, is to change the username and password of the webpage (server) and store them too on the Flash.
I am able to change them an write them on the Flash but when i reboot the ESP32S3, they get somehow deldeted from the Flash (only username and password. IP, subnet and Gateway stay on the Flash).
I am using the preferences.h library for that.
With the help of serial.print() i am debugging and making sure that the username and password are written on the Flash.
Any ideas why i am countering this problem?

Thanks in forward.

I will take a SWAG and say you are trying to use the simulated EEPROM maintained in the FLASH memory. If this is correct your description indicates to me you are writing to the "EEPROM", all works great then when powering down it forgets. Add this line to your code "EEPROM.commit();", this causes the RAM that is being used to simulate the EEPROM to the flash. The "Cstart" program, bootloader, or whatever it is called copies this from flash to RAM upon reset. Good Luck!

Check this link out: ESP32 Flash Memory - Save Permanent Data | Random Nerd Tutorials

Thank you @gilshultz .

No i ma not using the simulated EEPROM.
I found my failure in the code and it works now.
I had forgotten to read the saved data from the Flash after rebooting so it doesn't copy the data in to the struct i am really reading from.
After reading the datat from the Flash evreytime the ESP32 reboots, now it works.

Thanks a lot for your replay.
Best regards

The ESP32 has a library called preferences where you can safe and load values in a *.ini-file style.
identifer = value

best regards Stefan

Thank you @ StefanL38

i have already read this tutorial.
It's great but i am using Ethernet for the communication.
Any way many thanks, but i have already figured out the failure.

Best regards