Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

serializing session objects

Posted on 2008-10-08
9
Medium Priority
?
364 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
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 2000 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

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

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

Many old projects have bad code, but the budget doesn't exist to rewrite the codebase. You can update this code to be safer by introducing contemporary input validation, sanitation, and safer database queries.
There are times when I have encountered the need to decompress a response from a PHP request. This is how it's done, but you must have control of the request and you can set the Accept-Encoding header.
Learn how to match and substitute tagged data using PHP regular expressions. Demonstrated on Windows 7, but also applies to other operating systems. Demonstrated technique applies to PHP (all versions) and Firefox, but very similar techniques will w…
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.

670 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