Session tracking and ctrl+n

Hi
i have a problem. i am using the servlet API for session trackin but when the user cliks ctrl+n a new
browser window is opened and the session is copied .
then the user can use twice the application.
how can i prevent him continueing using the applicaion twice?
please help.
Dana

I don't think u can block function KEYS in any
browsers. You can block normal key pressed events
using Javascript but function keys are overridden by
the browser vendors code.Please people, stop posting guesses, as it is more time consuming to deprogram the people that try these inane methods than to show them how to do it right the first time.
I've already posted how to do this in a simple javascript funtion. Now here's the equivalent in a Jscript funtion:
<BODY onload="document.body.focus();" onkeydown="ctrlDown();">
The event handler is defined as:
function ctrlDown() {
if (event.ctrlLeft) {
alert("Left CTRL Pressed");
else {
if (event.ctrlKey) {
alert("Right CTRL Pressed");
     document.body.focus();
OK? Got it? Tried it? Yes it worked huh? Did you know you can trap any chars?
Now while the rest of the know universe is trapping the CTRL key these two ways, you guys can continue to invoke methods, hide variables, and create additional jsp's to parse session beans set with useless properties.
Frank Krul

Similar Messages

  • Session tracking and Internet Explorer

    Hi,
    I am currently maintaining a servlet application, on apache/jserv.
    This application implements a session tracking using a shared static hashtable of session data, associated with session id's.
    This application may open more than one client browser windows.
    With netscape, no problem.
    With Internet Explorer, since the version 6, when the client close at least one window, the session is closed.
    Thus, the application reject any new request from this client, sent by still open windows (session cannot be retrieved in the hashtable).
    Has somebody heard about this problem ?
    Thanks for any answer.

    Thanks.
    In fact, I believe that IE keeps the same session for
    child windows.
    The problem is: when you click on a link which open a
    new window, the new open window share the session with
    its parent window.
    When the new window is closed, the session is also
    closed.
    It appears that this mechanism only exists since the
    version 6 of IE.No. Earlier IE version handle session cookies the same way.

  • Session trackion and ctrl n

    Hi
    i have a problem. i am using the servlet API for session trackin but when the user cliks ctrl+n a new
    browser window is opened and the session is copied .
    then the user can use twice the application.
    how can i prevent him continueing using the applicaion twice?
    please help.
    Dana

    Ok, now
    if the user presses Ctrl + N, it creates a new window, so , in for that
    just check at the top of the jsp
    page like this
    <%
    HttpSession session = request.getSession(false);
    %>
    this gets the session if it is already there, otherwise, it won't create a new one but return null so
    check like this:
    <%
    HttpSession session = request.getSession(false);
    if(session != null){
    //create one here
    }else{
    //notify that he is already using one...
    %>

  • Tomcat Session Tracking with Object Post and Repeated Applet Jar Download

    Hi there,
    I have an issue with session tracking in Tomcat (5.0.28) and the JRE repeatedly downloading the original Applet Jar.
    Everything works fine (session tracking and HTTP GETs) until I post an Object from the Applet to a Servlet and the Servlet reads the Object.
    After that happens the JRE downloads the Applet Jar about 20 times and continues to download it after further requests to the Servlet.
    Not sure if the following is related but I'm parsing XML returned by the Servlet in the Applet and I get the following in the Tomcat logs:
    127.0.0.1 - - [08/Feb/2005:08:43:12 +0000] "GET /[webapp_path]/servlet/META-INF/services/javax.xml.parsers.SAXParserFactory HTTP/1.1" 404 1142
    If I turn off the session tracking in the Servlet it all works fine.
    I'm using the standard HTTPSession tracking API.
    Any help is much appreciated as this is a serious issue!
    Ian

    ...furthermore...
    I've now found I had disabled caching in the JRE.
    If I enable it the immediately after a POST (not an Object) then the Applet is repeatedly downloaded and it appears more so than before.

  • What is session tracking in servlets?

    Hi ,
    I'm studying servlets I don't have the clear idea about session tracking and Why and where we need to use it. Can any one say about this.....
    Thanks in advance,
    Maheshwaran Devaraj

    Well Mheshpmr session tracking in servlets is very important...There are a number of problems that arise from the fact that HTTP is a "stateless" protocol. In particular, when you are doing on-line shopping, it is a real annoyance that the Web server can't easily remember previous transactions. This makes applications like shopping carts very problematic: when you add an entry to your cart, how does the server know what's already in your cart? Even if servers did retain contextual information, you'd still have problems with e-commerce. When you move from the page where you specify what you want to buy (hosted on the regular Web server) to the page that takes your credit card number and shipping address (hosted on the secure server that uses SSL), now let me tell you, how does the server remember what you were buying?
    Well There are three typical solutions to this problem.
    1. Cookies. You can use HTTP cookies to store information about a shopping session, and each subsequent connection can look up the current session and then extract information about that session from some location on the server machine. This is an excellent alternative, and is the most widely used approach. However, even though servlets have a high-level and easy-to-use interface to cookies, there are still a number of relatively tedious details that need to be handled:
    * Extracting the cookie that stores the session identifier from the other cookies (there may be many, after all),
    * Setting an appropriate expiration time for the cookie (sessions interrupted by 24 hours probably should be reset), and
    * Associating information on the server with the session identifier (there may be far too much information to actually store it in the cookie, plus sensitive data like credit card numbers should never go in cookies).
    2. URL Rewriting. You can append some extra data on the end of each URL that identifies the session, and the server can associate that session identifier with data it has stored about that session. This is also an excellent solution, and even has the advantage that it works with browsers that don't support cookies or where the user has disabled cookies. However, it has most of the same problems as cookies, namely that the server-side program has a lot of straightforward but tedious processing to do. In addition, you have to be very careful that every URL returned to the user (even via indirect means like Location fields in server redirects) has the extra information appended. And, if the user leaves the session and comes back via a bookmark or link, the session information can be lost.
    3. Hidden form fields. HTML forms have an entry that looks like the following: <INPUT TYPE="HIDDEN" NAME="session" VALUE="...">. This means that, when the form is submitted, the specified name and value are included in the GET or POST data. This can be used to store information about the session. However, it has the major disadvantage that it only works if every page is dynamically generated, since the whole point is that each session has a unique identifier.
    Servlets provide an outstanding technical solution: the HttpSession API. This is a high-level interface built on top of cookies or URL-rewriting. In fact, on many servers, they use cookies if the browser supports them, but automatically revert to URL-rewriting when cookies are unsupported or explicitly disabled. But the servlet author doesn't need to bother with many of the details, doesn't have to explicitly manipulate cookies or information appended to the URL, and is automatically given a convenient place to store data that is associated with each session.

  • Session variable and Tracking in Header file

    Is there a way for me to keep track of the session and use a variable in my Header to pass around for this?
    I have a login.jsp, validate_login.jsp and other jsp's that have the same header file. Instead of me using the same code in all of the jsp's I thought it would be easier to put it in the header Please look at the example code below:
    // validate_login.jsp is passed username and password from the login.jsp.
    // validate_login then calls the logIn method in my Session class.
    <%@page contentType="text/html"%>
    <%@page pageEncoding="UTF-8"%>
    <%@page import="uom.edu.rd.session.Session"%>
    <html>
    <head><title>Validate Login</title></head>
    <body>
    <jsp:include page="header.jsp" />
    <%
        String username = request.getParameter("username");
        String password = request.getParameter("password");
        this_session.logIn(username, password);   
        boolean b = this_session.getLoggedIn();
    %>
    ==================================================================
    // The logIn method in Session class
    public void logIn(String userName, String password) {
             Connection con = null;
             Statement stmt = null;
             ResultSet rs = null;
             try{
                con = db.getConnection();
                 stmt = con.createStatement();
                 String sql = "SELECT * FROM RD_USER WHERE USER_NAME = '" + userName +"' AND USER_PASSWORD = '" + password + "'";
                  rs = stmt.executeQuery(sql);
                  if(rs.next()){
                       loggedIn=true;
                  }else{
                       loggedIn=false;
             catch(Exception e){
                  // If something goes wrong, make sure
                  // the user is not logged in.
                  loggedIn=false;
              }finally{
                  try{
                       rs.close();
                       stmt.close();
                       con.close();
              }catch(Exception e){
         * Log the user out.
        public void logOut() {
             loggedIn = false;
         * Get the login status.
         * @return boolean
        public boolean getLoggedIn() {
             return loggedIn;
    ==================================================================
    // and this is part of my header.jsp
    <%@page import="uom.edu.rd.session.Session"%>
    <%
      Session this_session = Session.findSession(request);
      if ( this_session==null ) {
          /* Now, instead of redirecting, create a new Session
           * object and initialize it.
          this_session = new Session();
          this_session.makeSession(request);
          this_session.createQueryBuilder(config);     
    %>
    // This is the part I would like to pass around
    <!-- Session logged_in = new Session(); -->
    <%   
        boolean loggedIn = this_session.getLoggedIn();    
            if (loggedIn == false)
            { %>
                <A STYLE="color:#FFFFFF;text-decoration:none;" HREF="./login.jsp"><FONT COLOR="#FFFFFF">LOG IN</font></a>  <FONT COLOR="#FFFFFF"></font>
        <%  } else { %>
                <A STYLE="color:#FFFFFF;text-decoration:none;" HREF="./logout.jsp"><FONT COLOR="#FFFFFF">LOG OUT</font></a>  <FONT COLOR="#FFFFFF"></font>
         <% }
    %>
    // so if you are logged in  then you are able to view certain things on the jsp's if you are not logged in
    // then of course you cannot. I want to pass around this loggedIn variable to all the jsp's
    // after it checks  loggIn Status for each page I have tried running this but I keep getting an error: cannot resolve symbol this_session

    Use <%@ include file="header.jsp" %> instead

  • Disable user and session tracking?

    Hi there?
    We would like to use Application Insights for everything except user and session tracking.
    How can i disable these features in AI (we may not use cookies in our site)?
    My guess is to change the applicationinsights.config file as below. Is there any documentation about the configuration file, right now im only guessing...
    Cheers
    /Niclas
    <?xml version="1.0" encoding="utf-8"?>
    <ApplicationInsights xmlns="http://schemas.microsoft.com/ApplicationInsights/2013/Settings" schemaVersion="2014-05-30">
    <!--
    Learn more about Application Insights configuration with ApplicationInsights.config here:
    http://go.microsoft.com/fwlink/?LinkID=513840
    -->
    <TelemetryModules>
    <Add Type="Microsoft.ApplicationInsights.Extensibility.Implementation.Tracing.DiagnosticsTelemetryModule, Microsoft.ApplicationInsights" />
    <Add Type="Microsoft.ApplicationInsights.Extensibility.RuntimeTelemetry.RemoteDependencyModule, Microsoft.ApplicationInsights.Extensibility.RuntimeTelemetry" />
    <Add Type="Microsoft.ApplicationInsights.Extensibility.PerfCollector.PerformanceCollectorModule, Microsoft.ApplicationInsights.Extensibility.PerfCollector" />
    <Add Type="Microsoft.ApplicationInsights.Extensibility.Web.WebApplicationLifecycleModule, Microsoft.ApplicationInsights.Extensibility.Web" />
    <Add Type="Microsoft.ApplicationInsights.Extensibility.Web.RequestTracking.TelemetryModules.WebRequestTrackingTelemetryModule, Microsoft.ApplicationInsights.Extensibility.Web" />
    <Add Type="Microsoft.ApplicationInsights.Extensibility.Web.RequestTracking.TelemetryModules.WebExceptionTrackingTelemetryModule, Microsoft.ApplicationInsights.Extensibility.Web" />
    <!-- <Add Type="Microsoft.ApplicationInsights.Extensibility.Web.RequestTracking.TelemetryModules.WebSessionTrackingTelemetryModule, Microsoft.ApplicationInsights.Extensibility.Web" />
    <Add Type="Microsoft.ApplicationInsights.Extensibility.Web.RequestTracking.TelemetryModules.WebUserTrackingTelemetryModule, Microsoft.ApplicationInsights.Extensibility.Web" /> -->
    </TelemetryModules>
    <ContextInitializers>
    <Add Type="Microsoft.ApplicationInsights.Extensibility.BuildInfoConfigComponentVersionContextInitializer, Microsoft.ApplicationInsights" />
    <Add Type="Microsoft.ApplicationInsights.Extensibility.DeviceContextInitializer, Microsoft.ApplicationInsights" />
    <Add Type="Microsoft.ApplicationInsights.Extensibility.MachineNameContextInitializer, Microsoft.ApplicationInsights" />
    <Add Type="Microsoft.ApplicationInsights.Extensibility.Web.AzureRoleEnvironmentContextInitializer, Microsoft.ApplicationInsights.Extensibility.Web" />
    </ContextInitializers>
    <TelemetryInitializers>
    <Add Type="Microsoft.ApplicationInsights.Extensibility.Web.TelemetryInitializers.WebOperationNameTelemetryInitializer, Microsoft.ApplicationInsights.Extensibility.Web" />
    <Add Type="Microsoft.ApplicationInsights.Extensibility.Web.TelemetryInitializers.WebOperationIdTelemetryInitializer, Microsoft.ApplicationInsights.Extensibility.Web" />
    <Add Type="Microsoft.ApplicationInsights.Extensibility.Web.TelemetryInitializers.WebUserTelemetryInitializer, Microsoft.ApplicationInsights.Extensibility.Web" />
    <Add Type="Microsoft.ApplicationInsights.Extensibility.Web.TelemetryInitializers.WebSessionTelemetryInitializer, Microsoft.ApplicationInsights.Extensibility.Web" />
    </TelemetryInitializers>
    </ApplicationInsights>

    I'm not sure if we have a documentation about this somewhere yet. But your guess was right. You can remove 2 modules and AI will not read and set cookies.
    Another option is to disable cookie setting but not reading. You would want this if you have JS SDK that sets cookies and you want Web SDK to read it and apply to server telemetry types.
    <Add Type="Microsoft.ApplicationInsights.Extensibility.Web.RequestTracking.TelemetryModules.WebSessionTrackingTelemetryModule, Microsoft.ApplicationInsights.Extensibility.Web" >
    <SetCookie>false</SetCookie>
    </Add>
    There are also 2 telemetry initializers for user and session. They take session and user from RequestTelemetry that was created by WebSdk and initialized in that modules and apply same session to other telemetry types like events and exceptions. If you cut
    modules you can cut telemetry initializers as well.
    Anastasia

  • Firefox just updated to 5.0.1 when it opens it opens two tabs, one a restore session tab and the other Firefox home tab. Nothing appears in the restore tab and everything freezes. Only way to get out is to ctrl, alt, del.

    After updating to Firefox 5.0.1 and trying to open Firefox, it opens two tabs. One is the restore session tab and the other is the Firefox home tab. Nothing opens in the session restore tab and once the Firefox home tab loads the browser screen freezes with no crash ID's listed. The only way to get out is thru the task manager and ending the process. Firefox worked fine before updating.

    Hi glivezey,
    Try typing ''about:home'' into the address bar. Is that the page you are looking for? If so, go to ''Tools > Options > General'' and save it as your homepage. If that home page doesn't show up the next time you start Firefox, you should look at [[Preferences are not saved]].
    Hopefully this helps!

  • How to open a URL without session ID and reuse the current browser session?

    Hi All,
    I have a question about HTMLDB 2.0
    How to open a URL without session ID and reuse the current browser session?
    That was the behaviour in HTMLDB 1.6 ...
    My usecase for this is the following:
    We have written an issue tracking application, which sends e-mail to the interested users, when something happens.
    In these email we've put a link to some page, with some parameters in the URL.
    The idea is for the user to be easy to click on the hyperlink and to see the details of the ticket.
    When the user clicks on such a link he is directed to a login screen (page 101) and he enters his Username and password, and is then forwarded to the details for the ticket.
    Then he receives another email (e.g. for another ticked). He clicks on the link and :
    a) in HTMLDB 1.6 he goes to the details as he didn't close his browser and session is remembered
    b) in HTMLDB 2.0 he is prompted to enter username, password with the username populated
    Please tell me how can I achieve the same behaviour in HTMLDB2.0 as it was in HTMLDB 1.6.
    I understand this change is somehow security related, althogh I don't understand how. If you can explain this either I would be very happy?
    Best regards,
    Mihail Daskalov

    Mihail - I detailed a couple of approaches here: Re: Application Link
    Scott

  • Session variable and initialization block issues

    We are using OBIEE 10.1.3.3 and utilizes built in security features. (No LDAP or other single sign on). The user or group names are not stored in any external table. I have a need to supplement Group info of the user to the usage tracking we implemented recently as the NQ_LOGIN_GROUP.RESP column contains username instead of group name. So I created a session variable and associated with a new initialization block and also had a junk default value set to the variable. In the initialization block, I wrote the following query and as a result it inserted correct values into the table when the TEST button was clicked from the initialization block form.
    insert into stra_login_data (username, groupname, login_time) values ('VALUEOF(NQ_SESSION.USER)', 'VALUEOF(NQ_SESSION.GROUP)', SYSDATE)
    My intention is to make this execute whenever any user logs on. The nqserver.log reports the following error and it doesn?t insert values into the table.
    [nQSError: 13011] Query for Initialization Block 'SET_USER_LOGIN_BLOCK' has failed.
    [nQSError: 23006] The session variable, NQ_SESSION.USER, has no value definition.
    [nQSError: 13011] Query for Initialization Block 'SET_USER_LOGIN_BLOCK' has failed.
    [nQSError: 23006] The session variable, NQ_SESSION.GROUP, has no value definition.
    When I changed the insert statement as below, this does get populated whenever someone logs in. But I need the values of GROUP associated with the user as defined in the repository.
    insert into stra_login_data (username, groupname, login_time) values ('TEST_USER', TEST_GROUP', SYSDATE)
    Could someone help me out! As I mentioned above, I need the GROUP info into the usage tracking. So, if there is another successful approach, could you please share?
    Thank you
    Amin

    Hi Amin,
    See [this thread|http://forums.oracle.com/forums/thread.jspa?messageID=3376946&#3376946]. You can't use the GROUP session variable in an Init Block unless it has been seeded from an Init Block first. There isn't an easy solution for what you want, but here are some options:
    1) Create a copy of your User => Groups assignments in your RPD in an table so you can use it in your Usage Tracking Subject Area. But this means you will have to replicate the changes in two places so it's not a good solution.
    2) As the GROUP session variable is populated when you login you could theoretically use it a Dashboard and pass it a parameter to write the value to the database. But as I am not sure how can you make fire only once when the user logins it sounds like a bad idea.
    3) Move your User => Groups assignments from your RPD to a DB table. Use OBIEE Write Back or something like Oracle APEX to maintain them.
    I think 3) is the best solution to be honest.

  • Session management and java Web Service

    Hi ,
    Can I have two web services one based on Session bean and other on Simple java class, packaged into single ear file? Does NetWeaver supports web service session management/tracking? How can I get an handle to HttpRequest in my Web Service?
    Any help will be appreciated.
    Thanks in advance
    regards,
    rajinder

    Container Managed Authentication. Does everything you need.

  • URL Session Tracking

    Hi,
    i want to make a group of JSP pages in a Web App, but assuming that the browser doesn't accept cookies.
    Is there anyway that i don't have to indicate every link as
    response.encodeUrl("index.jsp")I've heard something about a <url-session-tracking/> tag, but i've tried to put in the web.xml file, but it doesn't work.
    I just want to put Index and the App Server takes care of putting the jsessionid info in front of the url
    Thank you

    Cancelling this question.

  • Can we use an overloaded constructor of a Java Bean with Session Tracking

    Hi Friends,
    If any one can solve my query.... It would be helpful.
    Query:
    I have a Java Bean with an overloaded constructor in it. I want to use the overloaded constructor in my JSP.
    1. One way of doing that is to use it directly in the "Scriptlets" (<% %>). But then I am not sure of the way to do session tracking. I think I can use the implicit objects like "session", "request" etc. but not sure of the approach or of the implementation method.
    2. Another way is through the directive <jsp: useBean>. But I cannot call an overloaded constructor with <jsp: useBean>. The only alternative way is to use the directive <jsp: useBean> where I have to write getter and setter methods in the Java Bean and use the <jsp: setProperty> and <jsp: getProperty> standard actions. Then with this approach I cannot use the overloaded constructor.
    Can any one suggest me the best approach to solve this problem ?
    Thanks and Regards,
    Gaive.

    My first reaction is that you can refactor your overloaded constructor into an init(arguments...) method. Instead of overloaded constructor, you can call that init method. This is the ideal solution if possible.
    As to the two choices you listed:
    1. This is OK, I believe. You can use scriplet to define the bean and put it into session scope of the pageContext. I am not sure exactly what you meant by session tracking; whatever you meant, it should be doable using HttpSessionAttributeListener and/or HttpSessionBindingListener.
    2. Agreed. There is no way that <jsp:useBean> can call a constructor that has non-empty arguments.
    Please tell me how it works for you.

  • F11 and ctrl+F11 not retrieving the last search

    I have created a form in oracle 10g.where F11 is enter-query and ctrl+F11 is execute-query.
    Every time its working fine.When ever I give any input and press ctrl+F11 its being executed and then if I press F11 then going to enter-query mode.
    But my problem is :-
    If I open the form and without giving any i/p I press F11 and ctrl+F11 consecutively then it should show the last search.While in my form its just asking to select a new search/query.

    Thanks a lot for the suggestion..
    First  queried in the form,then without closing that in the same session I pressed F11 twice.
    But I am getting an error-
    FRM-41009: Function key not allowed. Press %s for list of valid keys.
    I have checked function key mapping its alright-F11:= enter query.
    I have given some messages to check the mode of the form at different position.
    I have key-entqry:-
    begin
        if :system.mode != 'ENTER-QUERY'  then
           go_item('blk1.leverandoer_kode');
        end if;
    message(:system.mode);pause;   -------------------> mode= NORMAL
      clear_form(no_validate);
      go_block('BLK1');
    message(:system.mode);pause; -------> mode= NORMAL
                         -------------> Here it prompting to enter F11 or cntrl+F11 again; Pressing F11
                         --------------> Here the error is coming (frm-41009) twice.
      enter_query;
      message('after enter');pause;                          -----------> Then its shoing this message
    message(:system.mode);pause;                       -----> mode= Enter-query
       end;
    Please help me out.

  • 3D tracking and snapping object to null?

    Okay so my teacher wanted us to use 3d tracking and then put in objects to texts in the video footage. I did the 3D analyzing and then put down my target on the screen. He then said that after the null was used for the tracking marker that I can put an image in it and snap that image to the null by pressing command. I'm on a PC at home. I'm sorry but I despise Mac. Since I don't have a command button and we use CC in school but at home I have CS6 I donno how to snap the picture to the null in CS6. Please help I'm freaking out.

    Alt and Option are the matching keys on a PC and a Mac
    Ctrl and cmmd are the other matching keys
    You can use two techniques for placing a new 3D layer in the same position as a null. Copy the position property of the null and paste to the new layer, or hold down the Cmnd/Ctrl + Shift key and make the null  the parent of the new layer. You can then remove the parent or leave it. If you do not see the parenting column in the timeline right click at the top and go to Columns>Parent.

Maybe you are looking for

  • Question about 'direct' parameter in sql loader utility

    Hi eveyone, Today I was asked what the advantages and disadvantages of 'direct' parameter of sql loader. In my opinion, if swithing direct on, oracle use direct path load. And it has no difference from the append hind in insert statement. The core me

  • Can't download music that I bought

    I downloaded now 85 on my mini ipad with my Apple ID, after the download I started to play some music but suddenly my mini ipad automatically turned off,  I then turned it on again and went to play my last purchase but it wouldn't let me play any mus

  • Want to install a free trial

    I downloaded a free trial for Adobe InDesign today on my Mac (OS X 10.9, Mavericks). I wasn't able to install the free trial as it only gave me a perpetual beach ball. I trashed the file and now I can't download the free trial for Adobe InDesign at a

  • 10.4.9 sound

    When I upgraded to 10.4.9, the sound came out of my intel iMac louder than before. The sound also comes out louder on the windows partition of my Mac, which makes me think it might be a firmware problem, but I am not sure. If anyone could point me in

  • CEWB: BOM item Mass change new value Missing

    Hi Guru's         When i plan to do BOM item lead time offset mass change in the (CEWB) Engineering Workbench, i have selected the ITem and Column LT offset, and in entra when i select the mass change, system showing a error. " no item selected", (ne