-
Notifications
You must be signed in to change notification settings - Fork 729
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
session-name.xml: use the correct directive name and add the link to #3642
base: master
Are you sure you want to change the base?
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -21,7 +21,7 @@ | |
<para> | ||
If a new session <parameter>name</parameter> is | ||
supplied, <function>session_name</function> modifies the HTTP cookie | ||
(and output content when <literal>session.transid</literal> is | ||
(and output content when <link linkend="ini.session.use-trans-sid">session.use_trans_sid</link> is | ||
enabled). Once the HTTP cookie is | ||
sent, <function>session_name</function> raises error. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Frankly, the whole part doesn't make much sense to me. The last sentence is particularly confusing. Maybe @Girgias can have a look at this. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. In russian docs, i translated the last sentence like this:
P. S. It seems to me that the whole paragraph makes sense, since it explains the behavior of the session mechanism a) when the 'session.use-trans-sid' option is enabled (which changes the name of the cookie data block and URLs in the page content for , of form and others fields, depending on the settings of the
mmalferov marked this conversation as resolved.
Show resolved
Hide resolved
|
||
<function>session_name</function> must be called | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I still don't understand this part. Does calling
session_name("whatever")
already output content (assumingsession.use_trans_sid=1
) and sends aset-cookie
header? I think this only happens during further script execution.Just looked at the German translation, and according to this it should better be: "(and the content of the output when
session.use_trans_sid
is enabled)"There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I understand it this way. The
session_name
function ONLY changes the session name (which is set to "PHPSESSID" by default). The session name is stored either a) in cookies (if cookies are enabled) or b) transmitted via URL (if cookies are disabled AND trans SID enabled).If cookies are enabled (in php.ini or in runtime), the
session_name
function changes the session name in the cookie data block, which is stored in the browser's cookie storage.If cookies are disabled and
session.use_trans_sid
is enabled at the same time, thesession_name
function changes the name of the session in the content of the HTML page, or rather in those elements of the HTML page that are set in thesession.trans_sid_tags
directive.Example 1, use the
session_name()
function with thesession.use_trans_id
directive disabled (default); storing and maintaining the session ID through cookiesThe above code outputs:
The URL of
<a>
is not modified; only the cookie has been set as"customCookieName=qdkt0ek4g6of1g8kehe2ejljl9"
and stored at browser storage.Example 2, use the
session_name()
function with thesession.use_trans_id
directive enabled (andsession.use_only_cookies
andsession.use_cookies
disabled); storing and maintaining the session ID through URLsThis code outputs: