ASP.NET dropping my session when redirected

EasyToHelp used Ask the Experts™
I have an app that gets sent to an external url to my payment gateway and then sent back but when the person gets back their session is gone.

How do have persistent sessions that only end if they timeout ?
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Does the URL gets changed someway like


How long the user spends in PG before returning back?


i think you might be onto something!!!

Not long like 1 minute - 5 minutes timeout is 60 minutes.

I think it is the www issue, any idea on how to rename URLS in IIS :D
Most Valuable Expert 2012
Top Expert 2014
I think the reason behind this issue is that when the URL is different, browser does not send the session cookie which was assigned to previous URL.

Two possible solutions

1) Use cookieless session
2) Make URLs identical

For both, you will need to make sure the payment gateway has a correct return URL.

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial