well, my question is simple, is a cookie secure in a HTTPS conection?
In the connection, yes. But It's still stored on the client's machine unencrypted.
Never thrust user input / session / cookies without validation.. Same for https / ssl
See also: http://stackoverflow.com/questions/606179/what-encryption-algorithm-is-best-for-encrypting-cookies
Cookies are sent within the HTTP header. Thus they are as secure as the HTTPS connection which depends on a lot of SSL/TLS parameters like cipher strength or length of the public key.
Please keep in mind that unless you set the Secure
flag for your Cookie, the Cookie can be transmitted over an unsecure HTTP connection. There are man-in-the-middle attacks that use such unsecure Cookies to steal session information. So, unless you have a good reason not to, always set the Secure flag for Cookies when you want them only transmitted over HTTPS.