Maintain session in curl on subdomains?

i have to login into a https url by curl. and im able to login successfully.
url is like this where i have to login


 https://secure.id.xxxx.com

and login is successfull.

now the problem is, i have to access url below with the sessions. but im not able to maintain it. i passes cookies phpsessid but still can not get success.


 http://id.xxxx.com
https://secure.id2.xxxx.com
http://test.id2.xxxx.com

somebody please help me. i spent lots of time on google and now not in the situation to figure it out by myself :frowning: and cant give more time

Use Curl’s COOKIEJAR parameters.
This does assume that the cookie assigned by this site uses the wildcard format. (it should, if the browser is meant to be able to use said cookie on all subdomains)