0

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?

1 Answer 1

1

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

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .