PHP - session_save_path
Trieda
Metóda - session_save_path
(PHP 4, PHP 5, PHP 7)
The function is used for getting or editing the location for storing session files.
Note: If you are editing the location, you have to do it
before calling session_start().
Procedurálne
- function session_save_path (string $path) : string
Parametre
| Názov | Dátový typ | Predvolená hodnota | Popis |
|---|---|---|---|
| $path | string | The new location for storing session files. |
Mávratovej hodnoty
Vracia: string
Returns the current location. If a new location is given, the function updates it and returns the old location.
Príklady
<?php
echo session_save_path() . "\n";
$previous = session_save_path('./sessions');
echo 'Current session files location is ' . session_name() . '. The previous location was ' . $previous;
// Now sessions will be saved into the "sessions" folder in the current directory
