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
    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. Advertising

  2. saurabhm

    biorezonanta

    Joined:
    Sep 2, 2009
    Messages:
    1
    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. Advertising

  3. saurabhm

    vzagkid@gmail.com

    Joined:
    Sep 9, 2009
    Messages:
    1
    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
    vzagkid@gmail.com, Sep 11, 2009
    #3
  4. saurabhm

    saurabhm

    Joined:
    Aug 20, 2009
    Messages:
    4
    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. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. bqmassey

    Storing class with session (ASP.Net)

    bqmassey, Sep 22, 2006, in forum: Software
    Replies:
    0
    Views:
    1,133
    bqmassey
    Sep 22, 2006
  2. rammca

    Session handling in ASP.Net 2.0

    rammca, Oct 25, 2006, in forum: Software
    Replies:
    0
    Views:
    3,774
    rammca
    Oct 25, 2006
  3. kalim
    Replies:
    0
    Views:
    1,054
    kalim
    Jul 12, 2007
  4. Fachmann
    Replies:
    1
    Views:
    1,433
    fred5152
    Dec 18, 2007
  5. imman

    session from asp to asp.net

    imman, Feb 20, 2008, in forum: General Computer Support
    Replies:
    0
    Views:
    899
    imman
    Feb 20, 2008
Loading...

Share This Page