Jump to content
php.lv forumi

vai sesijas == cookies


org.102

Recommended Posts

Citāts no PHP dokumentācijas:

Passing the Session ID

 

There are two methods to propagate a session id:

 

    *      Cookies

    *      URL parameter

 

The session module supports both methods. Cookies are optimal, but because they are not always available, we also provide an alternative way. The second method embeds the session id directly into URLs.

 

PHP is capable of transforming links transparently. Unless you are using PHP 4.2 or later, you need to enable it manually when building PHP. Under Unix, pass --enable-trans-sid to configure. If this build option and the run-time option session.use_trans_sid are enabled, relative URIs will be changed to contain the session id automatically.

 

    Note: The arg_separator.output php.ini directive allows to customize the argument seperator. For full XHTML conformance, specify & there.

 

Alternatively, you can use the constant SID which is always defined. If the client did not send an appropriate session cookie, it has the form session_name=session_id. Otherwise, it expands to an empty string. Thus, you can embed it unconditionally into URLs.

http://lv.php.net/manual/en/ref.session.php

Link to comment
Share on other sites

×
×
  • Create New...