Question

I built a tree menu with treeview , having the option persist set to cookie. When I click a submenu of a particular menu then I call an ajax to retrieve database data and rewrite accordingly the code of the HTML unordered list of the tree menu, then I rebuild the menu by calling treeview.

In that ajax I call session_start() at the beginning. My question is : does session_start() clear any previously set cookie ?

Was it helpful?

Solution

No. It might add another cookie as a session cookie, and if that cookies name conflicts with any previously set cookie, that cookie might get deleted or overwritten or become unaccessible to PHP, but this is not the regular case.

OTHER TIPS

session_start allow you to manage sessions:

1- take control over an existing session

2- create new session

  • manipulate some header directive

Unless your first cookie is set using the $_SESSION variable then they shouldn't affect each other. Regular cookies and PHP sessions are independent.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top