Forum Moderators: coopster

Message Too Old, No Replies

Mix PHP and ASP Sessions

         

nbozic

6:05 am on Jul 8, 2004 (gmt 0)

10+ Year Member



Hi,

I ran into a situation where I need to use one session variable with both PHP and ASP. Here is the situation...
The first page (login page) is PHP. It must be because it uses the GD image functionality, so that users can enter the random security code, along with username and password. When I generate the random security code, I need to store it in a session variable to be used by the next page.
The next page is an ASP page, and it needs to check if the security code the user entered matches the security code in the session variable. It also connects to the database and checks the username and password. This page must stay ASP.

I still didn't get it to work... can it be done?
Are there any effective and secure workarounds?

Thanks,

NB

coopster

2:30 pm on Jul 8, 2004 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



Why not use user-level session storage, keeping the session_id in a database which the ASP script would then check for authentication?

httpwebwitch

3:04 pm on Jul 8, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Yup. Keep your session data in a database rather than in PHP's secret session brain. There are many pre-cooked classes to help you do that.

You've got a fun challenge there, nbozic. PHP and ASP don't usually play well together. As you work on this, please post your adventures here in an ongoing narrative; I work with both ASP and PHP but I never conjugate them, so ... I'm interested.

good luck!

nbozic

7:15 pm on Jul 8, 2004 (gmt 0)

10+ Year Member



Thanks, I'll give it a try and I'll post what i came up with.

PS: Great idea by the way.