CSRF attacks are prevented by validating unique, unpredictable, and user-specific tokens (like trnsactToken) associated with the current session. HTTPS only encrypts communication to prevent eavesdropping, and encrypting session cookies does not prevent the browser from automatically sending them in CSRF scenarios.