By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
429,334 Members | 2,746 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 429,334 IT Pros & Developers. It's quick & easy.

Getting session id of ASP pages from PHP.

P: n/a
I want to develop some code in PHP that is part of an ASP application.

I am wondering if there is anyway to get the session ID of an ASP page
(or any other scripting language) from PHP.

I assume that session id's are kept as cookies on the user's desktop.
If that's the case there should be some way of retrieving them.

Has anyone ever accomplished such a linkage?

Thanks

Jul 1 '06 #1
Share this Question
Share on Google+
3 Replies


P: n/a
In article <11**********************@m79g2000cwm.googlegroups .com>,
j_********@yahoo.com (ImOk) wrote:
I am wondering if there is anyway to get the session ID of an ASP page
(or any other scripting language) from PHP.

I assume that session id's are kept as cookies on the user's desktop.
If that's the case there should be some way of retrieving them.

Has anyone ever accomplished such a linkage?


The following worked in perl for ASP 1 - they might have changed the
cookie format since then.

foreach $_ (split /; /, $ENV{'HTTP_COOKIE'}) {
$session_id = $1 if /ASPSESSIONID.{8}=(.{24})/;
}

--
To reply email rafe, at the address cix co uk
Jul 1 '06 #2

P: n/a
Looks reasonable (except for that perl gunk :)

Care to translate.

Thanks

Rafe Culpin wrote:
In article <11**********************@m79g2000cwm.googlegroups .com>,
j_********@yahoo.com (ImOk) wrote:
I am wondering if there is anyway to get the session ID of an ASP page
(or any other scripting language) from PHP.

I assume that session id's are kept as cookies on the user's desktop.
If that's the case there should be some way of retrieving them.

Has anyone ever accomplished such a linkage?

The following worked in perl for ASP 1 - they might have changed the
cookie format since then.

foreach $_ (split /; /, $ENV{'HTTP_COOKIE'}) {
$session_id = $1 if /ASPSESSIONID.{8}=(.{24})/;
}

--
To reply email rafe, at the address cix co uk
Jul 2 '06 #3

P: n/a
In article <11*********************@j8g2000cwa.googlegroups.c om>,
j_********@yahoo.com (ImOk) wrote:

Looks reasonable (except for that perl gunk :)

Care to translate.
I wrote it years back, so I'd have to work through it all again, and I
don't have that set-up at the moment. You should be able to translate into
PHP's perl compatible regexps, but you'll need to check the current cookie
format.

--
To reply email rafe, at the address cix co uk
Jul 2 '06 #4

This discussion thread is closed

Replies have been disabled for this discussion.