Bug #69006 [Fbk]: session fail to start?

From: Date: Sat, 07 Feb 2015 18:34:43 +0000
Subject: Bug #69006 [Fbk]: session fail to start?
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-190512@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=69006&edit=1

 ID:                 69006
 Updated by:         yohgaki@php.net
 Reported by:        simon_freedom125 at hotmail dot com
 Summary:            session fail to start?
 Status:             Feedback
 Type:               Bug
 Package:            Session related
 Operating System:   windows
 PHP Version:        5.6.5
 Block user comment: N
 Private report:     N

 New Comment:

Correction.

> Regardless of session.use_strict_mode,

session.use_strict_mode=Off required.


Previous Comments:
------------------------------------------------------------------------
[2015-02-07 18:32:33] yohgaki@php.net

Regardless of session.use_strict_mode, following code should work

session_name('MYSESS1');
session_id('2342424234242424323423');
session_set_cookie_params( some params);
session_start();
//do something. Copy $_SESSION to other var, if needed.
session_commit();

session_name('MYSESS2');
session_id('abasdfasdasbafdewra');
session_set_cookie_params( some params);
session_start();

------------------------------------------------------------------------
[2015-02-07 18:18:03] yohgaki@php.net

Why do you set cookie by yourself? It should be done by session module.
Use session_set_cookie_params() and session_start().

If you're enabling session.use_strict_mode (i.e. session.use_strice_mode=On), disable it to set
your own ID. Beware that you are less secure with session.use_strit_mode=Off.

If you need to use certain session ID to share under use_strict_mode=on, get already initialized
session ID after session_start() and use it.

This should solve your issue.

------------------------------------------------------------------------
[2015-02-07 16:56:51] simon_freedom125 at hotmail dot com

Description:
------------
The actual version of php is actually 5.6.3

The session does not persist when I set cookie for the session id to last not until the browser is
closed. example, to last for a day.
When the session id is set to last until the browser is closed, the session start works on
subsequent page request.

Tested on 3 browsers - chrome, mozilla, and IE. This only happens on IE.
realized this problem after upgrading from php 5.4+

I used the session_name function to change the default, so I am not using PHPSESSID. Not sure what
is the actual cause.

Test script:
---------------
session_name('sessionID');
setcookie('sessionID',$sessionID,time()+3600*24,'/',NULL,true);



------------------------------------------------------------------------



--
Edit this bug report at https://bugs.php.net/bug.php?id=69006&edit=1


Thread (16 messages)

« previous php.bugs (#190512) next »