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 ?

有帮助吗?

解决方案

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.

其他提示

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.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top