Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

i need to edit the default permits of the session file

i know it's high security risk,

The default permits is :600

[root@server sessions]# stat sess_06pqdthgi49oq7jnlvuvsr95q1
  File: `sess_06pqdthgi49oq7jnlvuvsr95q1'
  Size: 0               Blocks: 0          IO Block: 4096   regular empty file
Device: 802h/2050d      Inode: 32473090    Links: 1
Access: (0600/-rw-------)  Uid: ( 5003/     ...)   Gid: ( 5003/     ...)

i want set default permits to 0777

This is my php.in

; The file storage module creates files using mode 600 by default.
; You can change that by using
;
;     session.save_path = "N;MODE;/path"
;
; where MODE is the octal representation of the mode. Note that this
; does not overwrite the process's umask.
;session.save_path = "/var/lib/php/session"
session.save_path = "/sessions"

i've changed the session.save_path to

session.save_path = "N;644;/sessions"

The new results is:

  File: `sess_avrc5442qjkcbd17g2qkenmit2'
  Size: 0               Blocks: 0          IO Block: 4096   regular empty file
Device: 802h/2050d      Inode: 32473090    Links: 1
Access: (0700/-rwx------)  Uid: ( 5003/     ...)   Gid: ( 5003/     ...)

it's now 0700 NOT 0777

WHY?

share|improve this question
add comment

1 Answer

Try umask(0) before session_start(). There are better ways of doing this with setacl on the folder.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.