Solved

serializing session objects

Posted on 2008-10-08
9
354 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
 
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
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

This article will explain how to display the first page of your Microsoft Word documents (e.g. .doc, .docx, etc...) as images in a web page programatically. I have scoured the web on a way to do this unsuccessfully. The goal is to produce something …
Generating table dynamically is the most common issue faced by php developers.... So it seems there is a need of an article that explains the basic concept of generating tables dynamically. It just requires a basic knowledge of html and little maths…
The viewer will learn how to dynamically set the form action using jQuery.
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

863 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

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now