IE8 looses some php session vars while keeping other intact on refresh or an ajax call
Have a big problem with php sessions on IE8 here. I've done some research on the web but no examples match (or I'm not capable of translating them into my scenario)
I have a site that makes an extensive use of session having multiple values and an array kept in session vars. Everything works fine on chrome and firefox but parts of the system break on IE8 as it seems to simply loose session information after refresh. All session vars on the site go through the same various actions including header(location) redirections, apache url rewrite etc.
Not all sessions vars tho. Here's example. When I log in and save an information to a session (eg.$_SESSION['user']), it works fine throughout the site and I'm not being logged out ($_SESSION['user'] is not being lost). A the same time tho I'm assigning different session vars and they can be lost on refresh even tho login var is still present
Here's some code for the part that doesn't work on IE8
1) I have a link on the page that allows to edit page you're viewing, let say link is /edititem/ID
2) clicking it links to a php file that retrieves item's data and saves a session var array. One of the fields in that array determines which html elements will be displayed on the edit form. After session vars are set up, there's a header() redirection
session_start(); $item = Item::getById($_GET["id"]); $_SESSION["item"]["type"] = $item->type; $_SESSION["item"]["title"] = $item->title; $_SESSION["item"]["action"] = "edit"; header('location: /item_management');
3) when landing on /item_management page on IE8 following that redirection, everything is ok. When I refresh that page tho, that session information set above is gone
I read about possible problems with urls that include _ on IE8. I changed those urls at some stage to use - instead of _ but that didn't help, so I reverted. I was also thinking it may be some problem with arrays in session but there's at least one more place in the code where non-array session is being lost when called in ajax call (I have $_SESSION["image"], do an ajax call, read that 'image' var in php called with ajax and it's empty).
Also, user session var is intact throughout the system, even tho other values go missing
All session related stuff works perfect on chrome/firefox
Any ideas? I will provide any piece of code required
I have noticed the same problem with my internal web application. Certain session variables, especially ones that were just updated into the database go missing upon refresh or even revert to older values of the variable. I have not found a solution so I've been having my users use a different browser than IE.
So I guess the only solution if you can is to let people know that IE has strange behavior and they should try to use a different browser if using your application.