PHP.nl

session_name

session_name

Get and/or set the current session name

 **session_name**  $name
returns the name of the current

session. If is given, will update the session name and return the session name. session_name``name``session_nameold

If a new session is supplied, modifies the HTTP cookie (and outputs the content when is enabled). Once the HTTP cookie has been sent, calling raises an . must be called before for the session to work properly. name``session_namesession.use_trans_sidsession_name``E_WARNING``session_name``session_start

The session name is reset to the default value stored in at request startup time. Thus, you need to call for every request (and before is called). session.name``session_name``session_start

name The session name references the name of the session, which is used in cookies and URLs (e.g. ). It should contain only alphanumeric characters; it should be short and descriptive (i.e. for users with enabled cookie warnings). If is specified and not null, the name of the current session is changed to its value. PHPSESSID``name

  > **Waarschuwing:** > The session name can't consist of digits only, at least one letter
     must be present. Otherwise a new session id is generated every time.

Returns the name of the current session. If is given and function updates the session name, name of the session is returned, return.falseforfailure. nameold

Voorbeeld: example

<?php

/* set the session name to WebsiteID */

$previous_name = session_name("WebsiteID");

echo "The previous session name was $previous_name<br />";
?>

session.name