Forum Moderators: coopster

Message Too Old, No Replies

Reading php session variables with .NET

         

Peb0

7:58 pm on Nov 3, 2005 (gmt 0)

10+ Year Member



Hey all,
I figured this could drop into either of the 2 obvious categories, so I opted here on the assumption that php scripters might more know .NET than .NET'ers know php...

Simple enough, I'm adding phpBB to a site and want to integrate a single logon.
The site is ASP.NET and my knowledge is well enough that I have several solutions, the simplest of which just reuses whatever session variables phpBB creates.

If a .php page sets a session variable, can I read it in an .aspx page?

I'm more curious than I have time right now, since I'm at work, but I can (and will) find out for certain myself tonight.

I'm too curious to know before then.
Can anyone answer before I leave to go home :P

Cheers
PebĪ

Peb0

8:04 am on Nov 4, 2005 (gmt 0)

10+ Year Member



Well, to answer...

Session is not directly interoperable between the 2 BUT

A simple interpreter will do the trick.

eg: On my login page, the first step looks for the existance of "xxblah" session variable and if it doesn't exist, redirects to an intermediate "php hunter".
The hunter iterates through all php session variables and plants them into a temp form that auto submits to an "aspx gatherer" page that in turn, assigns all the form fields and values into aspx session variables. Finally, it redirects back to the originating page. (Of course the gatherer could only look for specific session variables)

In the end there are 2 parallel session variable collections, but it gets the job done.

Anyone got a cleaner solution?

PebĪ

jatar_k

3:59 pm on Nov 4, 2005 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



if it works then that should be fine

the only other way I could see it is to write it all to db then you could pull it from there