note 100855 added to session.configuration

From: Date: Thu, 11 Nov 2010 06:00:20 +0000
Subject: note 100855 added to session.configuration
Groups: php.notes 
Request: Send a blank email to php-notes+get-173938@lists.php.net to get a copy of this message
This is how I set my session.save_path session.save_path = "1;/home/askapache/tmp/s" So to create the folder structure you can use this compatible shell script, if you want to create with 777 permissions change the umask to 0000; sh -o braceexpand -c "umask 0077;mkdir -p s/{0..9}/{a..z} s/{a..z}/{0..9}" Then you can create a cronjob to clean the session folder by adding this to your crontab which deletes any session files older than an hour: @daily find /home/askapache/tmp/s -type f -mmin +60 -exec rm -f {} \; &>/dev/null That will create sessions in folder like: /home/askapache/tmp/s/b/sess_b1aba5q6io4lv01bpc6t52h0ift227j6 I don't think any non-mega site will need to go more than 1 levels deep. Otherwise you create so many directories that it slows the performance gained by this. ---- Server IP: 212.124.37.9 Probable Submitter: 24.123.215.58 ---- Manual Page -- http://www.php.net/manual/en/session.configuration.php Edit -- https://master.php.net/note/edit/100855 Del: integrated -- https://master.php.net/note/delete/100855/integrated Del: useless -- https://master.php.net/note/delete/100855/useless Del: bad code -- https://master.php.net/note/delete/100855/bad+code Del: spam -- https://master.php.net/note/delete/100855/spam Del: non-english -- https://master.php.net/note/delete/100855/non-english Del: in docs -- https://master.php.net/note/delete/100855/in+docs Del: other reasons-- https://master.php.net/note/delete/100855 Reject -- https://master.php.net/note/reject/100855 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#173938) next »