Re: [PHP] Question about session_id() and session_start()

[email protected] (Tim Schofield)
Newsgroups php.general
Message-ID <CABsfisjWmGDMj9gPT37V1Y1W2LFBrSDcD38r4BfxC_v_r+Zh3A@mail.gmail.com>
On 20/05/2013, Maciek Sokolewicz <[email protected]> wrote:
> On 20-5-2013 22:14, Tim Schofield wrote:
>> Matijn
>>
>> There are well over half a million lines of source code in PHP. It seems
>> a
>> little unhelpful to tell someone to go and read half a million lines of C
>> when you could just tell them the answer?
>>
>> Thanks
>> Tim
>>
>> Course View Towers,
>> Plot 21 Yusuf Lule Road,
>> Kampala
>> T +256 (0) 312 314 418
>> M +256 (0) 752 963 325
>> www.weberpafrica.com
>> Twitter: @TimSchofield2
>> Blog: http://weberpafrica.blogspot.co.uk
>> On May 20, 2013 6:24 PM, "Matijn Woudt" <[email protected]> wrote:
>>
>>> On Mon, May 20, 2013 at 5:33 AM, 孟远涛 <[email protected]> wrote:
>>>
>>>> I find the Note in PHP document.
>>>> http://www.php.net/manual/en/function.session-id.php
>>>>
>>>> "Note: When using session cookies, specifying an id for session_id()
>>>> will
>>>> always send a new cookie when session_start() is called, regardless if
>>> the
>>>> current session id is identical to the one being set."
>>>>
>>>> I feel puzzled about this feature. Even if the current session id is
>>>> identical to the one one being set, session_start will send a new
>>> cookie. I
>>>> want to know why session_start behave in this way.
>>>>
>>>> Forgive my poor English. Thanks in advance.
>>>>
>>>
>>> You will find the answer in the PHP source code.
>>> If you don't want this to happen, check if the current session id
>>> matches
>>> with the value you want to set it to, and don't set if they match.
>>>
>>> - Matijn
>>>
>>
>
> Tim,
>
> first of all, please bottom-post on this list.

Tell that to the designers of the android gmail app :-)

> Secondly, a simple google search for "php c session_start" resulted in
> this:
> https://github.com/php/php-src/blob/master/ext/session/session.c#L1303

That wasn't the advice given. The advice given was to read the source
code. My point was that is not very helpful advice. With a few notable
exceptions the help given on this list has become less and less
friendly over the years I have been reading it. This can't be good for
the PHP community.

>
> - Tul
>
>

Tim

-- 
Course View Towers,
Plot 21 Yusuf Lule Road,
Kampala
T   +256 (0) 312 314 418
M +256 (0) 752 963 325
www.weberpafrica.com
@TimSchofield2
Blog: http://weberpafrica.blogspot.co.uk/
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.