I’m currently developing a website in PHP, however a large section of the website (that I can’t redevelop) is in ASP.NET.
I require a system where our clients can login, and then be logged in to both the PHP and the ASP pages of our site. I’ve done a bit of research and come up with a few ideas but I’m not sure what the best method is?
- Use a cookie that both languages can access and read/write to
- Use some sort of HTAccess/Digest Auth that will result in one login for all pages
- Use a DB session that both can read, although not sure how to implement this, especially seeing as I’m having trouble accessing the MSSQL server from PHP, only a MySQL – can ASP access a mysql server?
- Some sort of login script as follows:
- User logins in and submits to PHP page
- Login processed with PHP and session created etc
- User/pw rePOSTed to asp page
- ASP page proccesses login and stores it’s session etc
- ASP returns back to ‘after-login’ page..
To be honest, I’m not sure what the best solution is! Your thoughts would be appreciated!
Thanks,
Dave
I don`t know the specific parts of your application but from the stated i would go for Cookie. It is easy solution, and pretty much solid. And if you have any session variables, well it is on the server side so you will not have any problems accessing them.
Any other solution, script or db session would be job duplication. But everything depends on the data you are storing and complexity/security you need.