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

Discussion in 'Software' started by saurabhm, Aug 20, 2009.

  1. saurabhm

    saurabhm

    Joined:
    Aug 20, 2009
    Messages:
    4
    Likes Received:
    0
    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
     
    saurabhm, Aug 20, 2009
    #1
    1. Advertisements

  2. saurabhm

    biorezonanta

    Joined:
    Sep 2, 2009
    Messages:
    1
    Likes Received:
    0
    Location:
    bucuresti, sector 4 romania
    hi, i have a question , if i know the ip can i found the address of computer ?
    thank you ,
     
    biorezonanta, Sep 2, 2009
    #2
    1. Advertisements

  3. saurabhm

    [email protected]

    Joined:
    Sep 9, 2009
    Messages:
    1
    Likes Received:
    0
    How to get vistor location ( country, state and city )

    How get the vistor(Client) location based on Client IP?
    i have to implement this in asp.net

    Thanks in Advance
    Vkid
     
    [email protected], Sep 11, 2009
    #3
  4. saurabhm

    saurabhm

    Joined:
    Aug 20, 2009
    Messages:
    4
    Likes Received:
    0
    Silly Problem Solved.

    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' :oops: :stupido: .

    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.

    Resolution

    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().ToLower().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"));
    }
    }
    :stupido: --->:veryprou: ---->:driver:

    "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."
     
    saurabhm, Sep 18, 2009
    #4
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.