Is there a way to start two sessions in PHP? I need to add one session for user login and another to keep product info for a session.

iTechScripts
1 min readJan 25, 2019

--

The answer is “no”. You cannot start multiple sessions simultaneously. And if you do, you’ll get an error like “A session had already been started”.

You don’t need to start simultaneous sessions, so long you can create multiple keys.

For example…

$_SESSION[‘key1’], $_SESSION[‘key2’]

All active sessions can be destroyed by the command “SESSION_DESTROY()”, or you can instead unset a particular key using “UNSET($_SESSION[‘key1’])”.

--

--

iTechScripts
iTechScripts

Written by iTechScripts

Leading Resource of PHP Scripts and Web/ App Development.

No responses yet