Pregunta

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 ?

¿Fue útil?

Solución

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.

Otros consejos

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.

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top