You can define a path to save your session files. Those file are generated when initializing a session and are commonly prefixed with “sess_” followed with the session ID. Go to your php.ini and search for:
You will probably find 2 results, you need the without the MODE option. It’s possible that you find an semicolon in front of it, if so, just remove it.
Now you can specify a path to a directory (need’s to be created in advance) where you want the session files saved. In this example the files are saved in a map, called sessions.
However, changing your php.ini file is not the only way to do it. You can specify a save path manually for a particular session only. Again, i used the same path as at the example earlier mentioned.
// Needs to be called before session_start()
session_save_path('C:\server\sessions');
// Initialize the session
session_start();
This line needs to be called before session_start() and needs to be repeated on each of the session related pages, otherwise the default save path will be used.
Mail this!
- Comments (0)
- PingBacks (0)
- TrackBacks (0)


» Latest comments