Skip to main content
Participant
July 1, 2009
Answered

Opening new window problem

  • July 1, 2009
  • 1 reply
  • 1349 views

Hi,

I have a problem in my application when opening new window by clicking on the button ( window.open('http://....') ). After new window opens, "parent" window becomes dead - all session variables are lost and as a result it throws user to the login screen (default page).

I noticed that URLs in both windows have the same CFIDs and different JSession IDs.

Does anybody know how to handle this problem, another words how to make new window open with new CFID?

I am not sure if this is the reason, but cannot imagine anything else.

Thank you in advance,

LKhodab.

    This topic has been closed for replies.
    Correct answer ilssac

    In the new window user is in lgged in state.

    I just need an advice what to do to avoid loosing session variables in the parent window.

    Actualy, I forgot to mention that after touching buttons on the parent window it kills the child's window session variables. Another words they cannot be active at the same time.

    Thank you,

    LKhodab.


    According to the HTTP protocol standard all requests are completely stateless and have absolutely no connection to any other reqeust that come before or after.

    To allow session state management, ColdFusion uses cookies to know when a new request should share data with some request that came before it.  These cookies can either be a pair named "CFID" and "CFTOKEN" or one named "JSESSIONID".

    When you use JavaScript to create a child window in a browser, ColdFusion knows nothing about this.  All it knows is that it is getting another request.  If this request does NOT contain valid cookies identifying it as belong to some existing session, ColdFusion is going to create a brand new session with completely new data.

    If you are seeing different JSESSIONID values when you open this child window, this is probably what is happening.

    1 reply

    Inspiring
    July 2, 2009

    Hi,

    Is it happening as soon as the new window is opened or after a considerable amount of time?.

    If the later thing is happening, then check your "sessiontimeout" attribute in the "Appliation.cfm" template, modify it accordingly.

    HTH

    LkhodabAuthor
    Participant
    July 2, 2009

    It is happening right after new window opens, same moment.

    Thanks,

    LKhodab.

    ilssac
    Inspiring
    July 2, 2009

    Actually you don't want the child window to use a new CFID, you want it to NOT use a new jsessionID.

    If you are seeing both CFID and JSessionID tokens, it is the latter that matters.  When the new window opens and sends a request to the server it is generating a new session for that browser.  A new session in which the user is not in a logged in state.