0

I am working on a project which is coded in ASP.NET now I need to add some PHP pages to it. But I have to pass the email address from ASP.NET to PHP page. I know its possible by using URL transfer method but its not secured as users can modify it. I need session transfer method to pass these values. Is there any direct way to do that or indirectly is it possible by using JavaScripts or jQuery or any other method?

Karthik Malla
  • 5,570
  • 12
  • 46
  • 89

1 Answers1

1

Is your information being passed over http or https? It makes a big difference. You can do something such as the following without getting too complicated:

ASP.NET > update the web.config to:

cookieRequireSSL=”true”

In your asp page:

HttpCookie cookie = new HttpCookie(‘name’);
cookie.Secure = True;
cookie.Value = ‘joe@example.com’;

It's also possible to do a separate session id for http (could be md5(securesessid)) and make the association in server level; Just remember not to trust an insecure sess if going back and forth.

In your php page:

<?php

session_start();

$_COOKIE['ASP.NET_SessionId'];

$cookies = getCookies();

$sessionId = $cookies['ASP.NET_SessionId'];

?>

another way is via php/soap:

var_dump($client->_cookies);

echo "cookie is ".$client->_cookies["ASP.NET_SessionId"][0];
dr. null
  • 197
  • 1
  • 2
  • 7
  • More information can be found here: [Setting Secure Cookie Flags](http://enablesecurity.com/2008/08/29/setting-the-secure-flag-in-the-cookie-is-easy/) – dr. null Aug 12 '11 at 16:42
  • Good! But this is passing value from ASP.NET page but what is the syntax to receive it in PHP page? – Karthik Malla Aug 12 '11 at 16:48
  • @dr.null - Can you please answer to this question http://stackoverflow.com/questions/8856894/passing-values-from-asp-net-to-php – Mad coder. Jan 13 '12 at 20:50