Cameron Owen
Cameron Owen

Reputation: 109

PHP ASP Sharing Sessions

I have be asked to build a site that is to be built in PHP but have found that they have another system running which they would like to keep that is build in ASP.net.

Is it possible to have a single sign on e.g the php site will allow users to register and come onto the site and then would those details be able to pass into the MSSQL database or atleast talk to the ASP.net backend or something along the lines of with a session and a cookie that is stored in the browser?

Or would the simple solution be to extend the functionality of the ASP.net backend and use ASP on the front end to so the whole site is ASP.net.

Upvotes: 3

Views: 256

Answers (3)

symcbean
symcbean

Reputation: 48357

You're talking about lots of different things here.

Yes, ASP can read/write PHP session data files (try google for some implementations).

Yes, you might be able to use the same authentication tokens in both systems - assuming you know how ASP stores/hashes the data

Yes, you could implement a webservice in ASP to provide authentication services to the PHP code

Yes, you could access both systems using a single-sign on.

No you can't just drop in your PHP and expect it to work.

Upvotes: 2

Tatsh
Tatsh

Reputation: 3690

If the domain (or FQDN) never changes then yes users will still be 'logged in' on the ASP site after having switched from the PHP site. Of course then on ASP side to look logged in it would have to read for a valid PHP session ID (from cookies), and get the associated data. You could have PHP's session callbacks write a format that both ASP and PHP can read easily in files, like JSON (instead of serialised PHP array), or you could just use a database both sites support to verify a session ID (probably easier and better for clustering). Both PHP and ASP can use a MSSQL database.

Upvotes: 0

geekuality
geekuality

Reputation: 350

I dont know for sure if this is possible but I'd start looking the solution from an external storage like Memcached - I assume that there is .net extensions for it also, that way you could create your own session storage with access from both sides.

Upvotes: 1

Related Questions