Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Forms based Authentication (.NET) in PHP or other Web applications

We have a site built using Forms based authenication in .NET, is there any way of accessing these sessions / user variables and roles in a PHP application?

like image 575
Jon Busby Avatar asked Dec 27 '25 15:12

Jon Busby


1 Answers

You need to create an own ASP.NET Session State handler, that can store session data in a way that can be understood by both platforms.

like this: http://www.exforsys.com/tutorials/asp.net-2.0/asp.net-2.0-customizing-the-session-state-mechanism.html

The data could be stored for example in a mysql database, and .net should create a unique session cookie, witch can easily grabbed by php. If php gets the the cookie, it can read the session data from the database. But this will only work under the same domain (because of the cookies)

So if you work under multiple domains, the first step is in every case the same, but, instead of using cookies, you need to give the session id to the other page trough for e.g. the url.

like image 102
therufa Avatar answered Dec 31 '25 19:12

therufa



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!