Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie

Reading PHP session Variables from an ASP.net Page without access to the script

Options
  • 15-09-2009 5:23pm
    #1
    Closed Accounts Posts: 2,268 ✭✭✭


    I have built an ASP.net page which is called from PHP. However I need to get session variables for my data. These are saved into a database and I was advised that I could look them up with a cookie but the cookie values saved into the database and the values in the cookie are totally different.

    Is there any way to pick up session Variables from PHP and look at them in ASP. I will have the relevant pages.


Comments

  • Users Awaiting Email Confirmation Posts: 351 ✭✭ron_darrell


    Why in the name of all that's good and holy would you try mixing multiple different scripting technologies in the one site? Are you trying to give yourself a breakdown? :)

    As far as I know (and I could be wrong but if I am the other posters to this problem won't be long in telling me :) ) there is no way to share session information between different scripting technologies. However there are a few workarounds.
    1. You could send the relevent variables as POST or GET variables to the new page
    2. You could store the session variables on the database and then query the database from the .Net page to retrieve the data. For this to work each set of session variables saved on the database would need some sort of unique identifier which would then need to be sent to the .Net page as a POST or GET variable to enable the retrieval.
    3. You could rewrite your .Net page as a PHP page and then access the session variables directly
    4. You could save the session variables to a cookie (which should be retrievable from the .Net page)

    Ok hopefully some of that will be helpful.

    Regards,
    RD


  • Closed Accounts Posts: 2,268 ✭✭✭mountainyman


    Ron you were a big help. I set and then retrieved the PHP session ID from the HTTP header and used that as part of a PHP script to save the information into a database.
    I then retrieve the unencrypted session ID and use that to look up the info that I need in asp.net.

    You really pointed me in the right direction.


Advertisement