|How do I make C# talk to PHP session||#1|
I have a C# web-app that I want to integrate with a PHP shopping cart, it this possible?
posted date: 2008-12-19 11:31:00
|Re: How do I make C# talk to PHP session||#3|
It's not possible unless it is in a database and you write a (de)serialization algorithm that works between both languages. If it's supposed to be a read-only access, I'd make a user with read-only access just for this purpose.If it is stored on the filesystem I'd consider it insecure to access it.
posted date: 2008-12-19 11:36:00
|Re: How do I make C# talk to PHP session||#4|
Well you need to describe the pieces in more detail really, but it will be non-trivial if it is possible.How about Response.Redirect to cart.php?inputparams=foo -> do work -> PHP redirect to thankyou.aspx?inputparams=barCan you consume the PHP as a service? Or request the output of the PHP as an HTTPWebRequest?
posted date: 2008-12-19 11:48:00
|Re: How do I make C# talk to PHP session||#5|
Indeed it depends on the details. Do you want the PHP app to run within your .NET environment? if so I would take a look at Phalanger, but I don't think it will work as you want. You can also tak a look at PHP on IIS, but that also would not give you a lot of info.As annakata mentioned I assume you would be better calling/redirecting to/from the PHP script into your ASP.NET website.And I have a feeling that will not be an easy job to do, so... lucky you ;)
posted date: 2008-12-19 12:07:00
|Re: How do I make C# talk to PHP session||#6|
There are a few options here. While Java has more options for integration, particularly for sessions, C#/.Net will probably rely upon other products to communicate.If this were background processing (eg processing of completed orders after checkout), it would probably be simpler. You want to mix web apps however. How and what you want to mix them could (and probably does) make this rather difficult--or at least uncharted waters. PHP runs under Apache and .Net web apps under IIS after all.You're going to have to go through another technology layer. Others have mentioned databases but that's not a viable or performant solution for session storage on live web apps.Your best bet is probably memcached, for which there is at least one C# client library. Here's an example of cross-platform serialization using memcached.beanstalkd may also be worth considering if you have background work processing. It's a distributed work queue process that has several client libraries (eg Ruby, PHP, Perl, Erlang). I couldn't see a C# version but that could probably be done. Refer to the protocol docuentation.I mention this because you could have PHP write work requests to beanstalkd rather than C# polling or interrogating the PHP session.
posted date: 2008-12-19 13:41:00
|Re: How do I make C# talk to PHP session||#7|
PHP stores its session in files.A client cookie contains the file name, the php.ini contains the path.It should be relatively simple to access php session data from dotnet.I'm looking for a library that does this, but if I cannot find one I'll write one myself.
posted date: 2009-11-10 01:29:00
|select page: « 1 »|