title: How to set correct file permissions with CGI::Session
body: <p>For anyone else reading this; it seems the issue was caused by permissions and suexec was part of the issue.  Having disabled suexec, all is well again (subject to consequential issues I may find later).</p>
  <p>Two files I have in (say) dir1, in /cgi-bin/dashboard-login/  and they use CGI::Session to manage the session.</p>
  <p>Both files set a new session like this:</p>
  <pre><code>my $session = new CGI::Session(undef, $cgi, {Directory=&gt;&quot;$sessions_dir_location&quot;}) or die CGI::Session-&gt;errstr;
  </code></pre>
  <p>This means the second file is actually opening the session created by file1. All good so far.</p>
  <p>File 3 is in the same sub-domain but in a different dir (/cgi-bin/dashboard/).  It also runs that session string but I get the following error:</p>
  <pre><code>Software error:
  new(): failed: load(): couldn't retrieve data: retrieve(): couldn't open '/var/www/vhosts/example.com/sessions_storage/cgisess_fc6c62eee135f6cd418defef4516a59c': Permission denied at index line 38.
  For help, please send mail to the webmaster (root@localhost), giving this error message and the time and date of the error.
  </code></pre>
  <p>In Filezilla, I see that the file permission is set to &quot;dfr (0640)&quot; for the latest session file but, the previous one has the permissions &quot;adfr (0640)&quot;  That adfr file can be opened in filezilla and didn't have any issues when I ran my scripts.  Now the session files are being created as &quot;dfr (0640)&quot;. IS there a way to set the server (or the CGI::Session), to apply &quot;adfr (0640) permissions?</p>
  <p>And, in your experience, is that the likely cause of the problem?</p>