Jessica Posted April 27, 2007 Share Posted April 27, 2007 I have a client who has a current login script which is written in ASP. She wants me to add a new form to it, and it would need to access the username and password. (I assume they are stored in the session the same way as we would in PHP) Is this even possible? Would I just access the session like usual? Quote Link to comment https://forums.phpfreaks.com/topic/48875-php-accessing-login-information-from-asp/ Share on other sites More sharing options...
Jessica Posted April 27, 2007 Author Share Posted April 27, 2007 Anyone? Quote Link to comment https://forums.phpfreaks.com/topic/48875-php-accessing-login-information-from-asp/#findComment-239583 Share on other sites More sharing options...
The Little Guy Posted April 27, 2007 Share Posted April 27, 2007 So you are going to remove the old form, and add a new one? <% Session("username")="Donald Duck" Session("age")=50 %> Welcome <%Response.Write(Session("username"))%> I don't really understand what your trying to do. Quote Link to comment https://forums.phpfreaks.com/topic/48875-php-accessing-login-information-from-asp/#findComment-239584 Share on other sites More sharing options...
neel_basu Posted April 27, 2007 Share Posted April 27, 2007 I've no Idea about ASP. Quote Link to comment https://forums.phpfreaks.com/topic/48875-php-accessing-login-information-from-asp/#findComment-239592 Share on other sites More sharing options...
Jessica Posted April 27, 2007 Author Share Posted April 27, 2007 I'm asking if ASP puts information in the session, can PHP access it? So if ASP does this: <% Session("username")="Donald Duck" %> Can I then do <?php $username = $_SESSION['username']; ?> Quote Link to comment https://forums.phpfreaks.com/topic/48875-php-accessing-login-information-from-asp/#findComment-239764 Share on other sites More sharing options...
neel_basu Posted April 27, 2007 Share Posted April 27, 2007 First test it. If the session folder and format of ASP sessions are same as PHP then PHP can access it. But both of them can access same Cookies. Quote Link to comment https://forums.phpfreaks.com/topic/48875-php-accessing-login-information-from-asp/#findComment-239786 Share on other sites More sharing options...
The Little Guy Posted April 27, 2007 Share Posted April 27, 2007 Reading this: http://forums.digitalpoint.com/showthread.php?t=178677 they say no They do suggest saving them in cookies, to access them in php. Quote Link to comment https://forums.phpfreaks.com/topic/48875-php-accessing-login-information-from-asp/#findComment-239791 Share on other sites More sharing options...
Ninjakreborn Posted April 27, 2007 Share Posted April 27, 2007 No you can't but there is a work around. You can set the PHP engine to parse ASP pages as well (anything in <% %> is parsed by the ASP engine, and anything in <?php ?> is parsed by the PHP engine). Once you have this set, then all asp pages are also ran through php's parser to look for any php code. Just have php then set a session (IN PHP) as well so you will have access to it. You can even set the PHP parser to parse asp file's using htaccess like this AddType application/x-httpd-php .asp Give that a try, in your htaccess file. Then where the session in ASP is being created, right below that just register the session variables with PHP too, so php can then work it's magic wherever you need on other PHP pages. Quote Link to comment https://forums.phpfreaks.com/topic/48875-php-accessing-login-information-from-asp/#findComment-239796 Share on other sites More sharing options...
The Little Guy Posted April 27, 2007 Share Posted April 27, 2007 You could also just use a token. Quote Link to comment https://forums.phpfreaks.com/topic/48875-php-accessing-login-information-from-asp/#findComment-239820 Share on other sites More sharing options...
suttercain Posted April 27, 2007 Share Posted April 27, 2007 You could also just use a token. Quote Link to comment https://forums.phpfreaks.com/topic/48875-php-accessing-login-information-from-asp/#findComment-239855 Share on other sites More sharing options...
Jessica Posted April 27, 2007 Author Share Posted April 27, 2007 Neel, I don't have access to any server with any ASP code to test it, or I would have just tried it. Sounds like this is going to take more time than the client is willing to pay for. Thanks guys. Quote Link to comment https://forums.phpfreaks.com/topic/48875-php-accessing-login-information-from-asp/#findComment-239955 Share on other sites More sharing options...
Barand Posted April 27, 2007 Share Posted April 27, 2007 This ASP code set the session var 'xyz' to "users_name", simulating a login <% session("xyz") = "users_name" %> Set up a simple ASP page to output the session data and put on clients site eg "getxyz.asp" <% response.write(session("xyz")) %> The nice thing about AJAX is that it doesn't care what flavour the the target URL comes in, it just gets whatever was written to stdout. Set up an xmlhttp request calling the above page and pick up the output. Quote Link to comment https://forums.phpfreaks.com/topic/48875-php-accessing-login-information-from-asp/#findComment-240010 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.