PHP Sessions

NetRegistry supports two methods of PHP session handling.

- File based session handling.
- Database session handling.

File Based Session Handling

For File Based session handling, you will be required to change the session save path from /tmp to your home directory. Your home directory is the absolute server path to your hosting space on our servers.

Note: To get the full server path to your domain, use the syntax:

/clientdata/clients/first-letter-of-your-domain/
second-letter-of-your-domain/your-domain/www/

e.g. domain netregistry.com.au will have a server path:

/clientdata/clients/n/e/netregistry.com.au/www/

Alternatively you can check the path in the Virtualhost section of TheConsole, in the FTP details section

Also, note that by default, session.save_handler is set to "user", this needs to be changed to "files". This needs to be changed in your code.

For further information, view: http://au.php.net/manual/en/function.ini-set.php

If the session.save_handler is set to "user", you will see an error on the screen, which will look something like this:

Fatal error: session_start(): Failed to initialize storage module: user (path: /clientdata/clients/e/x/example.com/www) in /clientdata/clients/e/x/example.com/www/file.php on line XX

This is because you are trying to use "user" mode, rather than "files".

The below should be added to your file:

ini_set("session.save_handler", "files");
session_save_path ("path_to_temp_dir/");

Where path_to_temp_dir/ is the full server path mentioned earlier.
If you are not sure what your path is, please do not hesitate to contact
us by e-mail on support@netregistry.com.au or by phone on 1800 78 80 82.

Database session handling

To use Database session handling, utilise database session handler instead.

To implement database storage, you will need to use session_set_save_handler()
to create a set of user-level storage functions.

For further infrmation regarding PHP commands, please visit www.phpbuilder.com

© 1997- 2008 Netregistry Pty Ltd