Somehow IE is losing a session variable. I have narrowed it down to IE - but not all IE's I created a website for a friend... www.peekpea.com Its almost completed with just a couple bugs to fix... pushed it to my hosting site under a sub folder for proper teseting before I give them the website. If you go to the site ( www.peekpea.com ) I create a session variable instantly the second you hit the site. ( it use to just check when you try to add an item but i have been pulling my hair trying to track down exactly what is happening. ) Click on Products, (let the page fully load - i have not fixed a bug yet if it doesnt fully load and you start to click) Then click 'order', and let that load, and then click 'add to cart'. What happens now is that in my asp.net code i check the session variable... if its nothing, I add a record to the db, retrieve the ID of that record and store it in the session variable. I move between aspx, pages... on refresh of the page, there should be now a "cart displaying" with your item you have added. This works in FF and Chrome. But if you do this in some IE's...nothing. ( not all the time though...seems to be random between friends computers ). Sometimes mine works sometimes it doesnt...same with theirs On page load of the products screen, if I put a textbox on the bottom and say textbox1.text = session("OrderID") then it is empty. I am stumped as to why IE is losing the session variable and FF and Chrome are not. I am still very new to asp.net so I am not exactly sure what to check. Miro
I have done some more testing and it is the session variable being lost. When you first enter the site I now have a label in the very bottom middle to display the session("OrderID") then when its IE and goes to product... that number changes in FF and Chrome it does not in IE when you add to cart- the number changes again It only changes cause on page load of the program ...i say if session("OrderID") is blank / empty / nothing then go get one. Any ideas anyone?
I have found the problem. Here is what it was - incase anyone else runs into it. I have been working on this for a couple days and would like to pass on my findings. The .com in question is registered at www.411hosting.ca When a 'mask' is enabled around the website...for domain forwarding... They put some markup around it. (see below) I have setup the same example with www.companyorange.ca that points to http://www.companyorange.com/_Live/TestSession if you are interested in testing yourself. I will leave it up for the weekend. + this website will be changing with me trying to come up with a solution as it has peeked my curiousity. Make sure between tests, you close ALL internet browsers before you go from the .ca to the actual whole link. This only happens on some IE browsers. This website displays the sessionID in a label above the button. So it should start off as NOTHING in both test cases. Click a button, the current date time gets shoved into a session("Variable") and sent to page 2. Page 2 reads the session variable and displays it in a label. Click the button - it sends it back. --------------------markup start <html> <head> <title>www.your411HostingDomain.ca</title> <meta name="keywords" content=""> <meta name="description" content=""> <meta name="robots" content="index, follow"> <meta name="generator" content="411.ca Forwarding Service"> </head> <frameset framespacing="0" border="0" rows="100%,*" cols="100%" frameborder="no"> <frame name="domains411a" noresize scrolling="auto" src="http://www.yourForwardedToDomain.ca/_Path/Folder"> <frame name="domains411" scrolling="no" noresize> <noframes> <h1><a href=" http://www.yourForwardedToDomain.ca/_Path/Folder ">www.your411HostingDomain.ca</a></h1> Please <a href=" http://www.yourForwardedToDomain.ca/_Path/Folder ">click here</a> to view the non-framed version. </noframes> </frameset> </html> --------------------markup end Because they are using the frameset, somehow the session variable gets lost between frames I do not yet have a solution/workaround for this issue - as i might not really need one as she will be hosting the page on her own somewhere. Any ideas on a work around in the meantime are appreciated. Miro
The solution is that you must add this to your web page headers HttpContext.Current.Response.AddHeader("p3p", "CP=\'IDC DSP COR ADM DEVi TAIi PSA PSD IVAi IVDi CONi HIS OUR IND CNT\'") Here is the link that finally solved the issue: http://aspnetresources.com/blog/frames_webforms_and_rejected_cookies.aspx Cheers'