简体   繁体   中英

Classic asp application session lost after Response.Redirect

Code is hosted on same server with two different domain one is Internal testing(abc1.com) and External testing(abc2.com) and different app pool for them, code is same and folder structure is same.

Session lost issue only for only one domain abc2.com.

Session set from one page and after Respone.Redirect trying to access session is lost in case of External testing site only.

Any one having any clues. How to troubleshoot issues?

There are actually two problems here;

As @John rightfully mentioned in the comments, if the domains don't match then your sessions aren't carried over. The reason is that for sessions to work classic ASP issues a unique cookie per visitor. Cookies are bound to a (sub)domain, if you run on two different (sub)domains the cookies set on one domain can't be read by the other domain.Therefore the session on one domain won't be matched to the other domain.

Unfortunately that still won't solve your problem completely, because each application pool in Classic ASP also creates it's own session cookie. That's why increasing processes on your application pool will also result in a messed up session scope.

So in short, sessions in classic ASP only work in the same domain using a single application pool process. The ony way to work around this is to write your own session scope, issue your own cookies per user, and store corresponding variables in a backend of your own.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM