devendraC wrote:I am using c++ with php 4.3.2.
Um. I think you might be more than just a little bit confused. You might be using OOP, or Object-Oriented Programming, but unless the link that sigix posted makes sense to you, you aren't using C++. You see, C++ is a programming language, a superset of the C programming language. It happens to be object-oriented, but creating objects and classes in PHP is not
"using C++". In other words, you're not using C++. You're using OOP, or the object model, or classes and objects, or however you care to describe it. But you aren't using C++, which is something completely unrelated (fundamentally speaking) to PHP.
Anyway, your problem is likely that you aren't including your class definition in the second file. To quote a comment in the documentation:
shanemayer42 at yahoo dot com
When putting objects in a session, you need to have declared the class of your session managed objects BEFORE they are restored with a session_register or equivalent call.
That means before the session_start()!
In other words, you need your class definition to be included in both files (both the originating page and the page on which you're attempting to restore the object), and in the second file, it must appear before the line on which you try to restore the object.