Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > General Computer Discussion > Software > ASP.Net Session Cookie Lost on mozilla/netscape After return from cross domain

Thread Tools

ASP.Net Session Cookie Lost on mozilla/netscape After return from cross domain

saurabhm saurabhm is offline
Junior Member
Join Date: Aug 2009
Posts: 4
Hi All,

I am suffering from a problem as described followed,

I have made an forms authenticated application and this is tied up with an payment gateway provider for money transections.
process flow is

1. user book any thing on my site then go to checkout option
2. On checkout i m redirecting my user to PG site with post values and post method.
3. User successfully reached at PG site , there he login and Pay his billed amount. then PG site redirect user to my site same as post method with posted values.
4. Problem Starts here , that when user come back to my site application redirect user to login.(only in mozilla and Netscape Browser)

I have tryed following things.

1. use Cookie mode="URI" (but now IE creates same prob)
2. Set auth cookie and make expiration long.
3. IIS session extented for 1 hour.

and many approchechs...........

Please reply as soon as possible.

Thanks in advanced
Saurabh Mishra
Reply With Quote
biorezonanta biorezonanta is offline
Junior Member
Join Date: Sep 2009
Location: bucuresti, sector 4 romania
Posts: 1
hi, i have a question , if i know the ip can i found the address of computer ?
thank you ,
Reply With Quote is offline
Junior Member
Join Date: Sep 2009
Posts: 1
How get the vistor(Client) location based on Client IP?
i have to implement this in

Thanks in Advance
Reply With Quote
saurabhm saurabhm is offline
Junior Member
Join Date: Aug 2009
Posts: 4
Thanks for reply & sorry for replying late,

I would have done that by many other process like save context in db before redirecting and after come back can re generate the session on the basis of
IP, cookie etc but in all that process i had to loss previous session, which are very essential for my app.

anyway but after some time of posting here, i had found the reason and solution of this 'Silly problem' .

The Problem is basically related to domain name means URL,
my app does not redirect the request like

(I) abc-com To (II) www--abc-com

When user loggin by the (I) the browser makes session cookie with domain without 'www' but payment gateway redirect to (II) means with 'www' so browser makes another session cookie as different domain.


I modified my app from global.asax in method of Application_Request to redirect user from first request to www .(if not coming) with status code "301".
below is the code.

void Application_BeginRequest(object ob, EventArgs e)
if (HttpContext.Current.Request.Url.ToString().ToLowe r().Contains("--abc-com"))
HttpContext.Current.Response.Status ="301 Moved Permanently";
HttpContext.Current.Response.AddHeader("Location", Request.Url.ToString().ToLower().Replace("--abc-com","--www-abc-com"));
---> ---->

"Small things makes more trouble then bigger,
Like You can sit on the top of mountain,
but you cant sit on the top of needle."
Reply With Quote

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Cross Domain Cookie? By IP Perhaps? @sh ASP General 1 10-30-2006 07:38 PM
Cross-domain cookie synchronisation Martin Doyle Java 0 04-20-2005 10:20 AM