Sjottil has asked for the wisdom of the Perl Monks concerning the following question:

Hi, I was wondering if there is any way of setting the session cookie (CGISESSID) attribute isSecure to true in Perl? I know at least in php it is easy to with:

ini_set('session.cookie_secure', 1);

Is there some similar way to do this in Perl?

Crossposted to Stackoverflow

Replies are listed 'Best First'.
Re: Setting session attribute isSecure
by Corion (Patriarch) on Jan 07, 2016 at 12:04 UTC

    See, for example the CGI documentation, if you are using CGI to send your cookies. If you use something else to send your cookies, you will have to look at that documentation for how to add the flag to the cookie header line.

Re: Setting session attribute isSecure
by choroba (Cardinal) on Jan 07, 2016 at 12:52 UTC
    Crossposted to StackOverflow. It's considered polite to inform about crossposting, so that people not visiting both sites don't waste their time hacking a problem already solved at the other end of the internet.
    ($q=q:Sq=~/;[c](.)(.)/;chr(-||-|5+lengthSq)`"S|oS2"`map{chr |+ord }map{substrSq`S_+|`|}3E|-|`7**2-3:)=~y+S|`+$1,++print+eval$q,q,a,
      Ok, sorry about this. Fixed. My first time posting here so wasn't aware of this. Will do so in the future, thanks!
        Some additional information that I forgot to mention in the original post: The session cookie is set with CGI::Session not with CGI::Cookie. I can't seem to find anywhere in the documentation on how to set the session's secure flag to true. Is this possible?