Solved

serializing session objects

Posted on 2008-10-08
9
358 Views
Last Modified: 2013-12-13
Hi

I have a series of classes written in php and passing around using session variables. Everything was working fine until I had to embed my inventory search pages in to different domains using iframes. even with iframe it works except IE. In IE+iframe doesn't pass the session variables correctly so I had to serialize my objects and save in to a tmp file first, and when i need the object in different page I unserialize the object from the tmp file. Even this is working fine, except when inheritance links are broken of the objects. I know that I have to include all the class definitions in to the file where I unserialize the objects, but still it won't keep the inheritances. I just include the class definition by using require_once('class.php'); .

Any ideas ?????

Thank you
~Prabath

0
Comment
Question by:ppeiris
  • 5
  • 4
9 Comments
 
LVL 3

Expert Comment

by:DerkArts
ID: 22674058
Not a real answer to your question, but you can fix the ie iframe session problem with a p3p header.

just put a .htaccess file in you server root (of the iframed page) with these lines:
#P3P Header example
header append P3P 'policyref="URI", CP="IDC DSP COR ADM DEVi TAIi PSA PSD IVAi IVDi CONi HIS OUR IND CNT"'

and your sessions should work like a charm.  Has something to do with ie security blocking session cookies from another domain.


0
 
LVL 1

Author Comment

by:ppeiris
ID: 22680363
Hi

Thank you for your reply

It is quite encouraging to see this solution. I have done exactly what you ask me to do, but still I am out of luck.

here is the link http://preview.nsource.com/lemieux/diamond_search.asp

the main domain is not my domain but the iframe contents are mine. if you see in the source page i have a domain call www.uniquediamondcollection.com. if you browse this site in firefox you can see the results, just go head and make a diamond search and do the second search, you will see the problem in IE.

I have created a .htaccess file in my root folder and add the lines below
#P3P Header example
header append P3P 'policyref="www.uniquediamondcollection.com", CP="IDC DSP COR ADM DEVi TAIi PSA PSD IVAi IVDi CONi HIS OUR IND CNT"'

in addition to this

LoadModule headers_module path/to/mod_headers.so
and
AddModule mod_headers.c
are enabled in my Apache server.

Am I doing something wrong or missing something ?

Thank you
~Prabath



0
 
LVL 3

Expert Comment

by:DerkArts
ID: 22680649
Have you added i to the root of the iframed page? Or the page that contains the iframe. Because i don't see the header in the request...

Secondly, you do NOT need to edit what i posted, i see you put the URL of the website instead of URI. Remove that, just put it in the .htaccess exactly as i posted. That should do the trick....
0
Networking for the Cloud Era

Join Microsoft and Riverbed for a discussion and demonstration of enhancements to SteelConnect:
-One-click orchestration and cloud connectivity in Azure environments
-Tight integration of SD-WAN and WAN optimization capabilities
-Scalability and resiliency equal to a data center

 
LVL 1

Author Comment

by:ppeiris
ID: 22681256
Thank you for your help

I have correct my mistakes and put the .htaccess file in to the root folder of the iframed domain (which is www.uniquediamondcollection.com) NOT in to the page that contains the iframe (i don't have access to that domain which is http://preview.nsource.com/)  still doesn't do the trick.

now my .htaccess file contents looks like this:
#P3P Header example
header append P3P 'policyref="URI", CP="IDC DSP COR ADM DEVi TAIi PSA PSD IVAi IVDi CONi HIS OUR IND CNT"'

what is the .htaccess file permission should be ? mine is set to 644 at this moment.

Thank you
~Prabath
0
 
LVL 3

Expert Comment

by:DerkArts
ID: 22681695
I still dont see the request. Could you try putting the the .htaccess in directory /Login/search/

0
 
LVL 1

Author Comment

by:ppeiris
ID: 22681819
it is there. is it possible if I can include the header information directly in to the <head> section ? if so how can I do that ? or can i copy all these in to a xml file and bring that fine using <link> tag if so could you please show me the html code ?

thank you
~Prabath
0
 
LVL 3

Accepted Solution

by:
DerkArts earned 500 total points
ID: 22681898
put this at the very top of loose_diamonds.php:

<?php header("p3p: CP=\"ALL DSP COR PSAa PSDa OUR NOR ONL UNI COM NAV\"");?>


0
 
LVL 1

Author Comment

by:ppeiris
ID: 22682050
Thank you very much and this works.
0
 
LVL 1

Author Closing Comment

by:ppeiris
ID: 31504401
Thank you very much for helping me to fix this problem. I still didn't get the .htaccess file working, now the site is working customer is happy and I have time in my hand to play around with .htaccess file. Thank you again for your great help.

~Prabath
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I imagine that there are some, like me, who require a way of getting currency exchange rates for implementation in web project from time to time, so I thought I would share a solution that I have developed for this purpose. It turns out that Yaho…
This article discusses four methods for overlaying images in a container on a web page
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
The viewer will learn how to dynamically set the form action using jQuery.

828 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question