0

I was wondering if it's possible to pass a session coming from PHP by simply clicking a link from the PHP site

from PHP site:

Click here

and then the ASP.NET site (www.123company.com) will get the value of id=1 and use it to validate an existing function.

Is it possible? Comments and suggestions are welcome. Thanks

2
  • 1
    Not sure if I understand... you're passing the value using the querystring so.... What do you need the session for? Commented May 5, 2010 at 14:37
  • @Claudio: thanks for the hat tip. already used querystring: codeproject.com/KB/aspnet/QueryString.aspx Commented May 5, 2010 at 14:53

2 Answers 2

1

My guess is no. You will have to maintain session in DB and when you navigate to the ASP.net site, it should access the same db to retrieve the session.

Sign up to request clarification or add additional context in comments.

3 Comments

@Yogendra: is there a way to get the existing URL of the ASP.NET site so I could just parse it to get the 'id=1' part?
I think since you are passing the value in query string, you should be good.
Why is this downvoted ? I guess using DB is the only option to pass session variables between ASP and ASP.Net and php and asp.net. If query string is used, the value can be retrieved using the headers or the forms. I am not sure which one.
1

Quick and dirty solution:

  • Create an .ASPX page which accepts parameters via the QueryString.
  • Have your .ASPX page do some validation to check that it is your PHP script that is accessing it (i.e. not Joe Public on the internet). Then have it set each of the QueryString parameters as session variables in the normal way.
  • When you want your PHP page to be able to set a value in the ASP.NET session, fire off a simple HTTP request to your special ASPX 'bridging page'. It will convert the querystring variables you've passed to it via the QueryString into Session values.

Providing the user maintains the current browser window, when navigating from your PHP script to your ASP.NET site, you should fine that does just the trick...

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.