473,385 Members | 1,384 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

File Permissions of PHP Session Files

Hi!

I noticed that the file permissions (unix) of the PHP session files
have only read and write permissions for the Apache process (600 or rw-
--- ---).

Does anyone have any idea where this permission is set ? I can't find
any
umask or chmod settings for it in the php.ini file. Can't find
anything in
the httpd.conf either. Is it set in the PHP code that implements
session_start()?

Thanks for any pointers

Oct 16 '05 #1
4 2990
Those files are created and modified by the the apache process, so you
probably want the umask of that user (most likely "nobody").

Just out of curiosity, why do you need to change the permissions on
those files?

Oct 17 '05 #2
I was trying to write a bash script to be executed by cron to clean up
old session files that were not properly removed, eg, when the user
didn't do a proper logout which would have activated a
session_destroy().

Apparently, the system (either PHP or apache) doesn't do 'garbage
collection' of such files as part of its normal operation. Or am I
missing something ?

Oct 17 '05 #3
Spendwiser wrote:
I was trying to write a bash script to be executed by cron to clean up
old session files that were not properly removed, eg, when the user
didn't do a proper logout which would have activated a
session_destroy().

Apparently, the system (either PHP or apache) doesn't do 'garbage
collection' of such files as part of its normal operation. Or am I
missing something ?


You are missing something - the default session handler does clear up old
files. Go RTFM.

Why do you think you need different permissions to remove them using a cron
job?

(you don't)

C.
Oct 17 '05 #4
Took a closer look at TFM :) I think I know why there are session files
almost a week old still lying around. The gc apparently only gets
kicked off on a 0.01 probability, based on default settings. And my
site haven't got that high a hit rate yet to trigger it often enough.

Well, that's one mystery solved!

Oct 18 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: JW | last post by:
I have a directory protected with .htaccess / .htpasswd. After I'm validated, I run a php script which bombs out when trying to write a file to that directory. If I chmod 777 on the directory...
0
by: Fran Tirimo | last post by:
I am developing a small website using ASP scripts to format data retrieved from an Access database. It will run on a Windows 2003 server supporting FrontPage extensions 2002 hosted by the company...
2
by: Fran Tirimo | last post by:
I am developing a small website using ASP scripts to format data retrieved from an Access database. It will run on a Windows 2003 server supporting FrontPage extensions 2002 hosted by the company...
1
by: raydelex | last post by:
I am new to securing a database with logins. My questions is: I want only one database to use a new Workgroup file that I have created, not all the Access databases that I bring up under my...
3
by: EMW | last post by:
My ASPX file is opened with two arguments, namely the Width and Height of the browser window. Since I've got more ASPX files, I need to keep these values. I was thinking of writing them in an XML...
2
by: Joergen Bech | last post by:
Trying to write an xml file from within a Session. Works fine if I do it in the Application_Start event of Global.asax, but not in the Page_Load event of an aspx page. If I give "Everyone" write...
7
by: Steve | last post by:
Hello, I am a beginner/intermediate c++ coder. I have a program that I am writing and would like to be able to distribute to some of my friends. The problem with this is that the data files...
1
by: chrisj | last post by:
I'm using freeASPupload and got some assistance integrating to a Member script. It works successfully. In this modified version there are two groups that use this upload script. Members of one...
3
by: sandromani | last post by:
Hello, I am working at a webbased file browser, where users will be able to access, rename, delete, etc files and folders. My question is, what is the best way to handle permissions /...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.