Reputation: 9726
I have an ASP.NET page that gathers some user information, then sends a post including a url to a third-party web site for processing. After processing the third party web site sends a post back to the url included in the original post. The problem is when the new page receives the post message the SessionID
is different and the user information is not in the new session. If I store the original SessionID
can I use it to connect to the original session?
Upvotes: 0
Views: 632
Reputation:
I've ran into situations like this before, I used a few different solutions.
One approach is similar to Nico's where the site asked for a URI to post back to, and I attached a guid which pointed to a temporary table in the database (I don't like putting the UserID in the URL just like that). My version was:
http://www.mysite.com/myThirdPartyCallBack?guid=abcd12345-fgsdfg-3rqwer
Then, you can get the value(s) back from the database that you put in there before third-party redirect.
Upvotes: 1
Reputation: 12683
The quick answer is no. You cannot reuse an existing session. The purpose of the session is to be unique to each visitor across multiple platforms (and browsers).
If I understand correctly the third party site is post asyncronously back to the URL specified. If this is the case then the third part request is being assigned a new session ID as it is a new session to your web application. I would suggest modifying your call back URL to post back some information that then allows you to locate the user information that was originally sent over. This can be done by just providing a querystring key that denotes the user ID, or more advanced point to a key in your web storage system to locate more details on the original request. Such as http://www.mysite.com/myThirdPartyCallBack?userID=abcd12345
On the other hand, if the following processes is happening. User posts a form to a third party site. Then the user completes some work on the third party site and is then redirected back to your site then this is more of a session timing issue. If this is the case then I would inspect your session timings to ensure they are long enough for user to complete the work on the third party site.
Just and idea.
Upvotes: 0