ini_set('session.cookie_secure', 1); [download]
Crossposted to Stackoverflow
In reply to Setting session attribute isSecure by Sjottil