13

The session files are saved at session_save_path().'/sess_'.session_id().

Is 'sess_' hard-coded?

If it can be specified, how do I do that?

1
  • 1
    If you've found an answer, submit an answer and accept it. Don't edit your question to include the answer, that's not how SO is meant to work.
    – user229044
    Oct 24, 2010 at 16:56

3 Answers 3

21

Yes, sess_ is a hard-coded prefix for the session file name. You can see that in the source file mod_files.c:

#define FILE_PREFIX "sess_"
1
1

I think it's hard-coded - at least, I can see no configuration option or parameter to control this.

The manual page for session_save_handler() provides a full example for a custom handler. If all else fails, you can use that to implement your own handler, and change the naming format there.

0

Answer found on http://php.net/manual/en/function.session-set-save-handler.php. It's hard-coded.

1
  • 1
    Where on the page does it say that?
    – Pekka
    Oct 24, 2010 at 16:58

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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