Warning: shell_exec() has been disabled for security reasons in /home/unixusrs/dmartin/htdocs/test.php on line 7

Warning: session_start() [function.session-start]: open(/var/lib/php/session/sess_8sd5ubm1t3dkqcl9n1vvmmos74, O_RDWR) failed: Permission denied (13) in /home/unixusrs/dmartin/htdocs/test.php on line 13

To see my page describing the peculiarities of PHP at SCCC , go to : http://www.seattlecentral.edu/~dmartin/docs/php-cgiwrap.html

To read my step-by-step howto for using sessions at SCCC, go to : http://www.seattlecentral.edu/~dmartin/docs/phpsess.html

To see the source of this script, go to : http://www.seattlecentral.edu/~dmartin/test.phps

Let's see if this script is running as 'dmartin'

This php script is running as the user:
Warning: system() has been disabled for security reasons in /home/unixusrs/dmartin/htdocs/test.php on line 39

Lets see if the session features are working...

Your session ID is 8sd5ubm1t3dkqcl9n1vvmmos74

You have seen this page 0 times.

To maintain a session with cookies, use the normal URL, like so...

http://www.seattlecentral.edu/~dmartin/test.php

To maintain a session without cookies, pass the session ID in the URL, like so...

http://www.seattlecentral.edu/~dmartin/test.php?PHPSESSID=8sd5ubm1t3dkqcl9n1vvmmos74

To remove the cookie and remove state information, click here..

http://www.seattlecentral.edu/~dmartin/test.php?ENDSESSION=true

There's nothing special about ENDSESSION, I just test for it at the beginning of the script and then reset the session if I find it.

Now lets look at some file permissions stuff...

Remember, this php script is running as the user:
Warning: system() has been disabled for security reasons in /home/unixusrs/dmartin/htdocs/test.php on line 91

Let's look at the file permissions in our session.save_path

In /var/lib/php/session...


Warning: opendir(/var/lib/php/session) [function.opendir]: failed to open dir: Permission denied in /home/unixusrs/dmartin/htdocs/test.php on line 98

If the permissions say '0600', then only the owner of those files can read and write to them. That means you can't write a script to read the contents of these files, only I can do that. That's pretty cool.

To see the source of this script, go to : http://www.seattlecentral.edu/~dmartin/test.phps

PHP Warning: Unknown: open(/var/lib/php/session/sess_8sd5ubm1t3dkqcl9n1vvmmos74, O_RDWR) failed: Permission denied (13) in Unknown on line 0
Warning: Unknown: open(/var/lib/php/session/sess_8sd5ubm1t3dkqcl9n1vvmmos74, O_RDWR) failed: Permission denied (13) in Unknown on line 0
PHP Warning: Unknown: Failed to write session data (files). Please verify that the current setting of session.save_path is correct (/var/lib/php/session) in Unknown on line 0
Warning: Unknown: Failed to write session data (files). Please verify that the current setting of session.save_path is correct (/var/lib/php/session) in Unknown on line 0