PHP - session_name
Trieda
Metóda - session_name
(PHP 4, PHP 5, PHP 7)
The function is used for getting or editing the current session name.
Procedurálne
- function session_name (string $name) : string
Parametre
| Názov | Dátový typ | Predvolená hodnota | Popis |
|---|---|---|---|
| $name | string | The new session name. |
Mávratovej hodnoty
Vracia: string
Returns the name of the current session. If a new name is given, the function updates the session name and returns the name of the old session.
Príklady
<?php
echo session_name() . "\n";
$previous = session_name('MY_SESSION');
echo 'The current session name is ' . session_name() . '. The previous name was ' . $previous;
