Codeigniter PHP multiwindow issue
Problem arise when user opens multiple window. In my application say when user click on the project info, the project id will be stored in session variable and when saving it will be save against the project. but if the user open project1 and opened project2 in seperate window, there creates a proble开发者_运维百科m when the user clicking save on project1. its getting saved to project2. Hpw to solve this problem.
If you use session then the session variable will get overwritten as you keep on opening pages in new window.
The solution is to use GET or POST method for sending and retrieving the values instead of Session.
You have a design error here. PHP sessions are mean to store data which should be preserve in subsequent access. i.e: the page language or the user login status.
The correct way to pass the id to all your controllers is using the URL or either GET / POST methods. You could even use the DB but I don't think it fits well here.
精彩评论