Reputation: 636
how to manage two or more session in a single project? i have two or more different session to manage for example the login of a user and some action that the user is doing in the site and when user has finished to do the specific action that specific session will be destroyed or unsetted, without logout the user.
Upvotes: 0
Views: 44
Reputation: 179994
A session can contain more than one value. Store the login as something like $_SESSION['user'] = 123
and your action as a different value, like $_SESSION['current_action'] = 'posting to stack overflow'
.
Then, you can do $_SESSION['current_action'] = null
to clear it out without destroying the session itself and all the other important data in it.
Upvotes: 2