• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 255
  • Last Modified:

PHP: session_set_save_handler: first parameter: what to set the save path to?

Hello Experts,

the session_set_save_handler has 6 parameters. the first one, Open, expects two parameters, where the first is the save path and the second is the session name.

What do most programmers set this save_path to?
In other words, what do I set this to?

thanks,
0
epifanio67
Asked:
epifanio67
  • 3
  • 2
1 Solution
 
themrrobertCommented:
Isn't that parameter sent to your function from php?
0
 
themrrobertCommented:
You are trying to make your own custom session handler, correct? You aren't simply just trying to use sessions, you want to invent your own wheel?


if so, in other words, you simply set up your custom session like this:
function open($path, $name) {
  global $session_path;
  $session_path = $path;
}
.....
session_set_save_handler("open", "close", "read", "write", "destroy", "gc");

Open in new window


When your "open" function is called, php will send you the save path. That save path is set in php config and doesn't need to be messed with
0
 
epifanio67Author Commented:
thank you experts...

:-)
correct...

on your example above, the method Open, I still don't see what $path is set to?

do I have to specify a directory on the server? example

$path = '/sessions';

or is there a default?

see what I mean?

thanks so much for your help..
0
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
saimazzCommented:
Depending on the type of server you're running it can vary. To locate the directory, search for the following in your php.ini file.

upload_tmp_dir = "/tmp"

The directory can be different for you.
0
 
epifanio67Author Commented:
thank you expert,

but I don't have to set $path to any directory... the variable $path is set at the php.ini file, correct?

sorry, I just want to make sure I understand...

thanks again...  

0
 
epifanio67Author Commented:
I got it... thank you experts..
0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

  • 3
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now