To understand the usage of the mentioned "cookie" value, look into "/usr/lua/webuicookie.lua" and where it's used (and how) in other LUA files (everything may be found below /usr in some sub-directories). It's not really hard to find it.
If you want to show your configuration files, use a "CODE" tag/block here and do not upload them to other sites ... if they get deleted there, no later reader can view their content and see your problem.
Why do you set "guimode" to "hidden"? Without further explanations, what's your goal and what you did already, it's senseless trying to understand your intentions.
To give you an example ... I can't see, why you're stopping some services (your commands numbered 1 to 3) and obviously expect now, that something changes as a result of your changed settings. Shouldn't services get restarted first to use the changed settings now?
Furthermore I'm a bit unsure, whether you're editing the "tr069.cfg" file in the correct manner - your statement:
if i do a restart the tr069.cfg will be deleted again
sounds "odd".
But it's really possible, that wrong settings get corrected on a restart, where a "fresh copy" of the default setting will be loaded or settings for the (currently) configured provider get applied again (after each restart).
On the other hand it could be so simple as explanation, that you're using a wrong approach to edit the file and save your changes ... those actions require a special process and you wouldn't be the first one, who fails on this task.
Research "editing a TFFS file" and do not take the whole sentence as the only hint - try to find themes, where the correct process was described or look into this script:
https://github.com/PeterPawn/YourFritz/blob/master/tffs/fritzos_scripts/tvi