Solved

serializing session objects

Posted on 2008-10-08
9
349 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
What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

 
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

Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

Join & Write a Comment

Introduction Many web sites contain image galleries; a common design for these galleries includes a page with a collection of thumbnail images.  You can click on each of the thumbnail images to see the larger version of the image.  This is easily i…
Password hashing is better than message digests or encryption, and you should be using it instead of message digests or encryption.  Find out why and how in this article, which supplements the original article on PHP Client Registration, Login, Logo…
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…
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 …

746 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

12 Experts available now in Live!

Get 1:1 Help Now