New session id with hosts or CNAME entry

I am hoping someone can help me out with a problem I am having with host names and session ids. This may be something simple that I have forgotten about, so here it goes.
Going through the jsp's below give different results, depending on the URL you use.
If you use http://localhost:8080 or http://machine_name:8080
The same session id will be seen on each page.
If you use http://test_01:8080
A different session id is displayed on each page.
What would cause this to happen?
Add the following files under the ROOT webapp of the default Tomcat 4.1.30 installation. Of course, I understand that storing data in servlet context like this is not a good idea, but for testing purposes it will do what is needed.
index.html:
Test_01
<br><br><br>
Call 1
index.jsp:
<html>
<center>
<%= request.getSession().getId() %>
<% application.setAttribute( "session1", request.getSession().getId() ); %>
<h1>Tomcat 1 Call 1</h1>
Call 2
</body>
</html>
index2.jsp:
<html>
<center>
<%= request.getSession().getId() %>
<h1>Tomcat 1 call 2</h1>
Call 3
<br><br>Session 1 ID:
<%= getServletContext().getAttribute( "session1" ) %>
<% application.setAttribute( "session2", request.getSession().getId() ); %>
</body>
</html>
index3.jsp:
<html>
<center>
<%= request.getSession().getId() %>
<h1>Tomcat 1 call 3</h1>
<br><br>Session 1 ID:
<%= getServletContext().getAttribute( "session1" ) %>
<br><br>Session 2 ID:
<%= getServletContext().getAttribute( "session2" ) %>
</body>
</html>
Add the following entry to your host file:
127.0.0.1 test_01
or
<your ip> test_01
or
add a CNAME entry
Thanks for any/all help.

No, it has nothing to do with host names, CNAME, DNS or anything.
The session ID is sent to the server from the browser in either a cookie header or as part of the "extra info" part of a URL with the request. If there is no session ID in either place, the server creates a new session. If there is a session ID, then it gets the session object (if it's not expired). Then it sends the session ID back to the browser with the response to that request (either as a cookie or encoded into the URLs in the page, which you have to do explicitly do for each URL). Click on a link, then the process starts again. The first time you go to a site, you have no session ID. The server just makes a new one.
The only thing that domain names have any affect on is cookies. Cuz cookies are name/value data associated with a domain name of the server (amongst other things). The browser, for security reasons, only sends cookies in requests to servers that set the cookie in the first place. The server can't get cookies that it didn't set.
So if you have a server running on your local machine, you can access that server in 3 ways:
1) localhost
2) network name
3) domain name
The browser can know quite easily that 1 and 2 are the same thing, and send cookies for either interchangably (not that it has to, but it seems you are seeing this happen, so...). But the browser will probably not make any assumption about 3's relation to 1 or 2. The association is generally to domain name, not necessarily IP address.
And it's really a moot point anyway. You should not typically be accessing a server from those 3 different means within the same session. Someone connecting to your server isn't going to use anything but #3 anyway, the other 2 (definitely #1 and #2 only works on the same LAN) wouldn't make much sense. So there's not going to be this issue at all. The session ID itself has no relation whatsoever to a client's domain name.

Similar Messages

  • New session started with an advertizing page and all my tabs are lost

    New session started with an advertizing page and all my tabs are lost. Restore the previous session is not active. How can I restore my tabs?

    This advice might come too late, but, don't exit Firefox! Or if you already did, don't start it back up again!
    ''If Firefox is running:'' Open your current Firefox settings (AKA Firefox profile) folder using either
    * "3-bar" menu button > "?" button > Troubleshooting Information
    * (menu bar) Help > Troubleshooting Information
    * type or paste about:support in the address bar and press Enter
    In the first table on the page, click the "Show Folder" button. This should launch a new window listed various files and folders. For best results, change the view to "Details".
    (''If Firefox not running, get to this folder by pasting the following in the Run box on the start menu and pressing Enter: %APPDATA%\Mozilla\Firefox\Profiles and then double-click into the most recently updated semi-randomly-named folder you find there.'')
    In the window that launches, scroll down and double-click into the '''sessionstore-backups''' folder. Save all files here to a safe location, such as your Documents folder, so Firefox doesn't overwrite them. We may be able to use them to recover your lost tabs.
    Also, if you return to the main level of the profile folder, you may find some sessionstore files. Copy those to the safe location as well.
    Could you report back on what you found?
    Note: If Windows hides the .js file extension from you, you can change a setting so that you can see all file extensions (this helps when renaming files). This support article has the steps: http://support.microsoft.com/kb/865219 or http://windows.microsoft.com/en-us/windows/show-hide-file-name-extensions
    The kinds of files you may find among your sessionstore-backup files are:
    * recovery.js: the windows and tabs in your currently live Firefox session (or, if Firefox is closed, your last session)
    * recovery.bak: a backup copy of recovery.js
    * previous.js: the windows and tabs in your last Firefox session
    * upgrade.js-''build_id'': the windows and tabs in the Firefox session that was live at the time of your last update

  • New session created with every request

    Hi there,
    I have an web application that we used to deploy on tomcat, websphere and bea without any trouble. We are trying to move to support OAS and the application gives this peculiar behavior:
    A new session is created with every single request by the client browser. I have searched these forums for the better part of today and read some interesting similar cases but none of the fixes seem to have any effect on my problem.
    Is there a different way I need to request the session object from the request in the app for OAS? Or is there a configuration that I should have? I am deploying the app as a .war file. Is there a better way to deploy on OAS, should I stick the war in a .ear?
    Any help on this would be most greatly appreciated!
    Thanks,
    -Adam

    I have a problem that matches with this subject line but its somewhat different. This original posting wants to create new session and invalidate the existing one but my problem is to keep the session invalide if it has expired for the browser.
    Anyways, here is my problem. I have JSP named entity_actions.jsp which has 3 pop-up links that opens up with code like:
    window.open('restaurantentry.do?entityName=restaurant')
    window.open('districtentry.do?entityName=district')
    window.open('baseentry.do?entityName=base')
    My web.xml has this tag:
    <session-config>
    <session-timeout>5</session-timeout>
    </session-config>
    And the way forward the response for each request is:
    context.getRequestDispatcher(urlString).forward(request, response);
    The code I check for session timeout is:
    private void checkForSessionTimeOut(HttpServletRequest request)
    throws SessionTimeoutException
    HttpSession current_session = request.getSession(false);
    logger.info(CLASS_OBJECT, "Session in checkForSessionTimeOut(): "+current_session);
    if (current_session == null)
    logger.error(CLASS_OBJECT, "SessionTimeOutException has thrown.");
    throw new SessionTimeoutException("sessionTimeOut");
    Now lets say I want to show the end user session expiry page after 5 mins of idle time. Now from entity_actions.jsp when I click/open any one popup first time after 5 mins of idle time/session expire,
    logger.info(CLASS_OBJECT, "Session in checkForSessionTimeOut(): "+current_session);
    this loggers shows current_session as 'null' and I can display session exp mesg on the popup page. But when I click/open any other popup or any other link on the page it DOES WORK instead of having current_session = null, it creates new one. And I can see the sessionid which is different than fist session created on the same base page/browser.
    The same pattern of code used to work on Tomcat and JRun before for showing consistant session expiry on all the clicks being made on the same browswer after session gets expire.
    Why OC4J / JDev 10.1.3 is creating new session on the same browser even after session has expired?
    How can I fix this?
    Thanks

  • New session created with every page request

    Hi,
    I have an application running in portal framset. A user logins into a portal and has access to several applications, that are displayed in a frameset. My application is creating a new session for every page in the application. Of course, I can't keep session variables and a large amount of sessions are being created. What could be the reason for this, and is there a work around?
    Thanks.

    There is a chance the you have cookies turned off. Sessions are maintained via a jsessionid which is stored in a user cookie. If you (or another user) don't use cookies, then the session will be lost.
    To fix this, every URL you use must be encoded, such that, if cookies are not used, the jsessionid is attached to the end of the URL. If you are using JSTL, the easiest way to do this is like this:
    <c:url var="formAction" value="someOtherPage.jsp"/>
    <form action="<c:out value="${formAction}"/>" method="GET">
    <c:url var="nextPage" value="nextInLine.jsp"/>
    <a href="<c:out value="${nextPage}"/>">Next</a> Or if you are not using JSTL, you can use scriptlets:
    <%
      String formAction = response.encodeURL("someOtherPage.jsp");
    %>
    <form action="<%= formAction %>" method="GET">
    <%
      String nextPage = response.encodeURL("nextInLine.jsp");
    %>
    <a href="<%= nextPage %>">Next</a>

  • I like to keep 2 sessions open, but today a new session opens with blank page and no bookmarks - why?

    I keep a session open pretty much all day but minimize it when I leave so someone else can use a session for whatever they want. Today when I open a new session (while mine is minimized) the page is blank and there are no bookmarks. I can hit the home icon and go to view and see my bookmarks but this is a pain

    Hey mate,
    I was having the same problem. If you upgraded to Lion - apparently there is a 'general tab' in the system preferences that has a box that you need to un check. (The box says something about restoring all last windows from last session)
    If you updated Safari but are not using Lion, here is how to fix it. Simply delete this item fromyour Mac HD and restart Safari.
    [USERHOME]/library/preferences/com.apple.safari.plist
    Hope this helps... It worked for me!

  • Synchronizing persistent tmux loginctl session ID with new session

    Hey all. Does anyone else have the issue with a persistent tmux session losing it's 'active' session status with loginctl after restarting the window manager (monsterwm in this case, logging in automatically on VT1 per the wiki)? This causes issues with udisks mounting priviliges. I'd think it'd cause issues with pulseaudio but it doesn't (and I don't understand why).
    So, to reproduce:
    1. Fresh reboot and login
    2. Open terminal. $XDG_SESSION_ID will be 1
    3. Open tmux instance. $XDG_SESSION_ID will be 1
    4. Restart the window manager
    5. Open terminal. $XDG_SESSION_ID = 3. loginctl session-status active=yes
    6. Reattach tmux session. XDG_SESSION_ID =1. loginctl session-status active=no
    Is there some easy way to keep these synchronized so I don't have permissions issues?
    Thanks!
    Scott

    No, it has nothing to do with host names, CNAME, DNS or anything.
    The session ID is sent to the server from the browser in either a cookie header or as part of the "extra info" part of a URL with the request. If there is no session ID in either place, the server creates a new session. If there is a session ID, then it gets the session object (if it's not expired). Then it sends the session ID back to the browser with the response to that request (either as a cookie or encoded into the URLs in the page, which you have to do explicitly do for each URL). Click on a link, then the process starts again. The first time you go to a site, you have no session ID. The server just makes a new one.
    The only thing that domain names have any affect on is cookies. Cuz cookies are name/value data associated with a domain name of the server (amongst other things). The browser, for security reasons, only sends cookies in requests to servers that set the cookie in the first place. The server can't get cookies that it didn't set.
    So if you have a server running on your local machine, you can access that server in 3 ways:
    1) localhost
    2) network name
    3) domain name
    The browser can know quite easily that 1 and 2 are the same thing, and send cookies for either interchangably (not that it has to, but it seems you are seeing this happen, so...). But the browser will probably not make any assumption about 3's relation to 1 or 2. The association is generally to domain name, not necessarily IP address.
    And it's really a moot point anyway. You should not typically be accessing a server from those 3 different means within the same session. Someone connecting to your server isn't going to use anything but #3 anyway, the other 2 (definitely #1 and #2 only works on the same LAN) wouldn't make much sense. So there's not going to be this issue at all. The session ID itself has no relation whatsoever to a client's domain name.

  • OCI bowser generates new session with each page load

    Here is a summary of my problem:
    I am trying to implement the SAP Open Catalog Interface (OCI) with our eCommerce software, but I am having issues with the Web browser that OCI uses.
    Our eCommerce software utilizes the browser session id to identify the user. Our issues is that the OCI browser supplies a new session id with each page load.
    The weird part is that if I open a standard instance of IE, access the site, and then access the site though OCI the same session is shared by both the OCI browser and the IE browser. The OCI browser is now able to maintain the session ID as the user browses the site.
    Thanks.

    Thank you for your quick response.
    I understand that session IDs are always unique, and should only last for as long as the instance of the browser is open.
    What I have seen happen is that the session ID will get recreated with each page load with in a single instance of the OCI browser.
    When the site is opened in OCI it logs the user in, and then redirects them to the homepage. The problem is that the load of the login page, and the load of the homepage have different session IDs. If the user then clicks on a link on the homepage that page load will again have a different page load. This causes the eCommerce system to see them as separate users.
    As I described when I open an instance of IE first it seems to work. This leads me to believe that the OCI browser can read the cookie information, but can't write or create. 
    I am trying to figure out why the OCI browser keeps generating new Session IDs.

  • Asynchronous SUBMIT or CALL WITH creation of NEW SESSION

    I'm doing monotonous comparisons between systems, but I do need to see the SAP standard comparison for each. So I have an ALV list that I'd like to double click a line entry that will spawn 3 NEW SESSIONS and I'll automatically populate the parameters.
    So, has anyone been able to SUBMIT or CALL WITH THE KEY BEING THAT IT MUST CREATE 3 NEW ASYNCHRONOUS SESSIONS. I'd be grateful if you'd share your experience in this regard. Thank you, Adrian

    Hi,
    You can try in this way.
    Create a new FM and place your code there. Call this FM using addition STARTING NEW TASK. It should work fine.
    Check out F1 help on CALL FUNCTION for more details and additions.
    Thanks,
    Vinod.

  • Have published iweb site for five years with no problems and just opened a new site and get - 404: Page not found  This error is generated when there was no web page with the name you specified at the web site.-is the problem with iweb or with hosting?  T

    I am sorry if thie is republished-My first time doing this and I am not sure what goes where and where to hear feedback.
    Have published iweb site for five years with no problems and just opened a new site and get -
    404: Page not found 
    This error is generated when there was no web page with the name you specified at the web site.-
    Troubleshooting suggestions:
    Ensure the page you are linking to exists in the correct folder.
    Check your file name for case sensitivity . Index.htm is not the same as index.htm!
    Temporarily disable any rewrite rules by renaming your .htaccess file if it exists
    is the problem with
    iweb or with hosting?
    One Apple tech started to fix Iweb and had to end session and the next said problem with hosting at Network Solutions as it published
    to local folder. NWS has checked sttting a few times-
    Any help would be extremely appreciated as trying to fix this for about five weeks
    Thanks VG
    <Email Edited by Host>

    It's a really bad idea to post your email address - it's an invitation to spam - and I've asked the Hosts to remove it. (Even though I've now noticed you mis-spelled it! - anyway, never post your address in a forum.)
    You have a site here: http://virginiagordon.com/www.virginiagordon.com/WELCOME.html
    If that's not the page you are having trouble with, what is that page's URL?

  • AOL host was unable to start a new session

    I really want to thank u barry for taking ur busy time to help me, i did like u told me download it aol 10.3.6, and delete it the previous version. and still is giving me a AOL host was unable to start a new session. maybe i missed something.
    I have a speedstream ss2624 router, my safari is working perfectlly fine its just my aol. do i have to get even an older version of aol?
    please guys i need a serious help, i figure must of u are very busy, but i would really appreciated.
    thanks dudes

    What kind of computer are you connecting with? Imac, powerbook, other?
    I am having a similar problem (same error) on a powerbook, but the problem is in my office (local network - sdsl router), and not at home (cable modem, wireless/4 port router) installed. With my office, I am having all sorts of other problems connecting to the network. I can only connect wirelessly, so I suspect that the AOL problem is linked to a larger network connectivity issue which I believe is ethernet incompatibility with the office's router. Best thing to do is take the client's machine to another location and see if it connects ok. If so, your client might be having some networking issues in his local space.

  • Firefox will not open new windows, opens with session restore every time I use it, and won't let me open the throubleshooting tab... Why?

    Whenever I try to open a new window, nothing happens. This includes clicking ctrl+N and through the drop down menu.
    Also, whenever I start firefox to browse the internet, it always open with a Session Restore with the previous session listed, even though I closed all the tabs and shut it down normally without any prompts telling me about saving multiple tabs.
    Finally, when I tried to troubleshoot this problem, the tab never appeared. The only options that work on the Help Menu are:
    - Firefox Help (after a few clicks)
    - Report Broken Web Site
    - Check for Updates
    - About Firefox

    Start Firefox in <u>[[Safe Mode]]</u> to check if one of the extensions is causing the problem (switch to the DEFAULT theme: Firefox (Tools) > Add-ons > Appearance/Themes).
    *Don't make any changes on the Safe mode start window.
    *https://support.mozilla.com/kb/Safe+Mode
    *https://support.mozilla.com/kb/Troubleshooting+extensions+and+themes
    There are other things that need your attention.
    Your above posted system details show outdated plugin(s) with known security and stability risks that you should update.
    *Shockwave Flash 10.0 r45
    Update the [[Managing the Flash plugin|Flash]] plugin to the latest version.
    *http://kb.mozillazine.org/Flash
    *http://www.adobe.com/software/flash/about/

  • Call transaction in new session with the value at hotspot

    Hi all,
    As a hotspot functionality I would like to open a new transaction in a new session with the value at hotspot. For that reason, I am using the FM ABAP4_CALL_TRANSACTION with the option STARTING NEW TASK.
    This FM is not working because Parameter ID is not Maintained for the field (Hotspoted). So no value is passing to new transaction.
    Please suggest any other way to implement this.
    Thanks

    Hi Anil..
    This is the Solution for ur Requirement.   try this program and change as per ur need.
    REPORT  ZSEL_CALL_TCODE.
    data : IT_KNA1 TYPE TABLE OF KNA1 WITH HEADER LINE.
    DATA : IT_SPA TYPE TABLE OF RFC_SPAGPA WITH HEADER LINE.
    SELECT * FROM KNA1 INTO TABLE IT_KNA1 .
    LOOP AT IT_KNA1 .
      WRITE:/ IT_KNA1-KUNNR HOTSPOT ON.
      HIDE IT_KNA1-KUNNR .
    ENDLOOP.
    CLEAR IT_KNA1-KUNNR.
    AT LINE-SELECTION.
    CASE SY-LSIND.
    WHEN 1.
    IF IT_KNA1-KUNNR IS NOT INITIAL.
    REFRESH IT_SPA.
    IT_SPA-PARID = 'KUN'.
    IT_SPA-PARVAL = IT_KNA1-KUNNR.
    APPEND IT_SPA.
      CALL FUNCTION 'ABAP4_CALL_TRANSACTION' STARTING NEW TASK 'S1'
        EXPORTING
          TCODE                         = 'XD02'
         SKIP_SCREEN                   = ' '
        MODE_VAL                      = 'A'
        UPDATE_VAL                    = 'A'
      IMPORTING
        SUBRC                         =
       TABLES
        USING_TAB                     =
         SPAGPA_TAB                    = IT_SPA
        MESS_TAB                      =
      EXCEPTIONS
        CALL_TRANSACTION_DENIED       = 1
        TCODE_INVALID                 = 2
        OTHERS                        = 3
      IF SY-SUBRC <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
      ENDIF.
    ENDCASE.
    <b>Reward if Helpful.</b>

  • Whilst using FF20.0.1 and now with FF21 the new tab thumbnails fail to open for each new session. Why?

    For a long time my chosen websites appeared as thumbnail images on the new tab page when I began a new session, maybe since about FF15, I don't recall for sure. Recently, however, whilst using FF20.0.1 this behaviour stopped and none of the thumbnail images for my selected websites opened up, although the links to them remained and this behaviour has continued to FF21, which I have been using since yesterday (19th May). This is not a serious issue, but I do like things to work properly and to understand why they don't. I don't know why there should be a relationship between the two events, but the problem began after having opened the new tab page and before the images opened up I clicked on one of the links - where the thumbnail image would normally be - to go to the website; thereafter FF failed to retain a memory of the thumbnail images from one session to the next. By the way, I never empty my history cache only my main web cache that has previously had no effect on my new tab thumbnails, not since about FF15 or so anyway.

    Cor-el, hi.
    When I opened FF about ten minutes ago I noticed that the new tab thumbnail image I had brought up from my previous session had been remembered, so I opened some of the other websites listed to bring back their images too; I then shut FF down, re-opened it and the new tab page to find all the images had been recalled. Next, I shut down the computer to determine whether or not the images were getting lost that way; on rebooting the computer and launching FF I again found the images were still there. Now I closed the new tab and emptied the main cache (43 MB); on opening the new tab the images were still opening (you will recall that when the new tab thumbnails first came out they disappeared on emptying the main cache). Bearing all this in mind I have not yet tried your suggestion of temporarily disabling the add-ons in safe mode because if the thumbnail images came up that would not currently tell me anything. Also, the problem I described in my first post does not remotely coincide with the installation of any add-ons, which have not been recent. Given then that my thumbnails are appearing after the cache has been cleared where does FF get them from now? I still don't understand this recent behaviour and why for the moment the problem is not occurring. Thanks again.

  • HT200169 Having a problem with Logic 9 on a Mac Pro.Working on a lenghty song and apparently session got corrupted.Doesnt let me export tracks,program crashes.Already tried start brand new session with the tracks imported into it but still wont export.Sug

    Hello,having a problem with Logic 9 on a Mac Pro.Working on a lenghty song and apparently session got corrupted.Doesnt let me export tracks,program crashes.Already tried start brand new session with the tracks imported into it but still wont export.Suggestions?

    Thanks, Ian. Yeah, that's how I do it now...or with the controls in the left side pane. Still, I would have liked that quick on-the-spot edit capability...especially while sketching.
    Ian Turner wrote:
    Sorry Mark, you are out of luck as it does not do that - it works the same as L8. The way I would achieve that with more accuracy and control would be to route all the tracks you want to fade to a Bus then use volume automation on the bus. To do this you will need to add a standard audio track, then re-assign it using (Control Click on the track header) to the Bus track. You can then automate volume/plugins etc on the Bus track.
    Ian

  • My iWeb site hosted on PowWeb not showing up with old URL - CNAME issue?

    Since Apple migrated my .mac account to MobileMe, the site I was updating and hosting on PowWeb shows only the old uncorrected site. When I publish the URL I get a weird MobileMe URL which doesn't work well as people are used to the original URL. Very confusing!
    I've called PowWeb and they seem to understand the issue, but still not working. Although they did say it might take some time to take effect.
    How do I get the site to to use the original URL rather than the Mobile Me URL?
    What is the appropriate CNAME for MobileMe, if that's the problem?
    Thanks!!

    The PowWeb Tech suggested I need more than web.me.com, like IP addresses, a record names.
    Doing it that way and doing it via URL forwarding are mutually exclusive. It's up to you to decide. It's much easier to just fix the URL forwarding which is currently botched than to start messing with IP's, CNAMEs and A Records.
    So I need to go into PowWeb and change the URL forwarding to: http://web.me.com/markh47/Garfield_LAX/Join.html ?
    Yes.
    Do you have any idea under what category name that would be?
    Ask them how to change your URL forwarding. Normally you just type your corrected web.me.com url into a form on line.

Maybe you are looking for

  • Oracle  Standard Manager Max No.Of Requests in Running Status

    Hi, We have a Batch Process program to Kick the Concurrent Programs from the Back-End. Based on the data, there are some programs which kicks more than once. Our issue is while kicking the programs, it kicks the same program multiple times at a time

  • Open picture files and display in fullscreen slideshow?

    I'm hoping for some help as I'm very new to LabView and quite lost.... I have a directory with many picture files (too many to put them all in a powerpoint slideshow) and i want to open them one by one and display them full screen with no border arou

  • Info view not recognizing correct processor family

    pc wizard 2004 recognizes my processor as a Thoroughbred core but info view recognizes it as a duron processor.  whats the problem here? could it be the bios or something? thanks for any help K7N2GM-L Athlon XP 2000+ @ 1.67 need anything else?

  • PSE 7 playing incorrect music media files

    I Have PSE 7 on my PC. It was upgraded from PSE 5 some time ago in 2009 and I thought it was working ok.  However, because I have recently been using the Slide Show creation feature, I have found that there is no sound with the music.  In trying to f

  • Update connection and Solaris 10 release 1/06

    Hello, I am newbie in Solaris administration. I installed Solaris 10 x86 release Jan 2006 (sol-10-u1-ga-x86-v*-iso.zip) and I can see and run Sun Update Manager. Do I need to install updateConnection-i386.zip also or it's the same as Update Manager i