@NotWegant (Sorry for my English).
When you make a GET request in the response, you will have cookies for this URL. Then you will save them. Is this option not working?
For your second question read this post from @Fox ,
maybe its what you need. Its in Russian, but you can
use translator. There is an example script too >