Oracle APEX session and application timing out - oracle-apex

For 2 days now, my APEX is timing out every 10 minutes or less and it makes me lose my work!
I've tried to clean browser cookies and all...

Timeout is set in application's Shared components, Security Attributes, Session Management section.
"Maximum Session Length" is measured in seconds. If unset, it defaults to 43200 seconds (which is 12 hours) (for Apex 19.1) so ... check what it is currently set to.

I think that what you are facing is that your killing your previous sessions.
Every time you log in on an APEX application, it generates a session for your user (it's the random numbers in your URL)
If you have another browser tab opened and you request another log-in on the application, then another session is generated and if you go back to the other tab and try anything there, you will be asked to log-in again and if you do, the other session that you just logged-in will be killed.
For each application you log-in, is generated a session id that is saved on cookies of your browser. So just make sure that there's no other window or tab opened of that application already on the same session of your browser (although you can use different browser or incognito mode).
Also, pay attention in any favorite links that you made that links an APEX application. The same thing will happen if you are already logged-in and click on the favorite link that has a session on its URL.
This all can be avoided if you configure "Rejoin Sessions" parameter on the APEX installation enviroment: https://docs.oracle.com/cd/E59726_01/doc.50/e39151/adm_wrkspc002.htm#BABJCGAG

Related

Share Win10 IE 11 cookie with all users on PC

I have a web product that integrates with a another product that runs on Win10 PCs. The core product launches an IE 11 browser session calling to my URL. The core product has a VERY basic parameter set such that I need to setup a local cookie to hold additional configuration data that can be read by my site when the PC connects. Due to how IE is launched on the PC, this configuration needs to be done once per user that logs into the PC. I need an easier way to get the cookie data into every user that uses the PC instead of requiring each user to perform the action that causes the core application to launch my page, stop their process, change to a config screen, enter all the config data, save it, return to the prior screen, and then test the process.
Thoughts? I HAVE to use a cookie and I HAVE to store the configuration data in the cookie due to the core application limitations and site requirements.
Thanks.
Cookie is created for specific user on a machine.
It did not designed for sharing that data with other users whether on same machine or on same work station.
So it looks like your approach for solving this specific problem is not correct. You can try to rethink about it and try to use any other way for sharing the data between the users on same work station.
If you continue with this approach than it can cause security related issues.
I tried to find but did not got any useful information for sharing the cookie between users on same work station.
Reference:
Can one cookie be shared by multiple users logged on to the same device?

Inform JavaScript of user being active in PowerBI embedded

I have a PowerBI report embedded on a page within my site. I have a 20 minute timeout on my site that will log the user out after 20 minutes of inactivity.
Unfortunately, since the user being active within the PowerBI embedded report doesn't make any calls to my server, the server thinks that the user has been inactive and logs them out.
Is there a way in PowerBI embedded to notify the Javascript on the page it is hosted in, to tell it that the user has clicked on buttons or selected charts, or generally been active? If so I can then make a call to a heartbeat API endpoint on my server that will keep their session alive.
You could listen for the events currently exposed by the powerbi-client library. It probably won't cover all user actions, but it may be sufficient.

Selenium Python: auto click allow for notification requests

I a have small scraper for Facebook that uses chromedriver.
However every time I login after a couple of seconds I have to click some button to allow Facebook notifications. Is there a way to do it automatically?
I've seen some suggest to press tab three times and then enter but I don't know when exactly I'll be prompted by the request and I don't want to press stuff at the wrong time.
Is there anything that can be one when creating the webdriver?
Most likely, this is because every time you start a new ChromeDriver instance you get an entirely new Chrome profile, just like if you opened a new private browsing session. So all the client specific settings that the page you want to test has defined via cookies will be lost and have to be set again. (The main reason why this is a good thing is that for automated testing, you'd like the page to be in the same state every time a new test visits it.)
There are however ways to emulate cookies for testing with WebDriver.
Example
Consider the page http://www.cnn.com for example. Every time you run a new test against that page, a bar at the bottom of the page will pop up asking you to accept their cookie policy:
The page stores the fact that you once clicked the "I agree" button in a cookie itself. You can use the Chrome content settings to identify which cookies a certain web page sets. Details on that can be found here: https://superuser.com/questions/244062/how-do-i-view-add-or-edit-cookies-in-google-chrome
For this particular page, the name of the responsible cookie is "CNNtosAgreed" and the value it is set to once you click the "I agree" button is "true".
In your WebDriver script you can use the manage cookies functionality to set specific cookies, so that the page you're testing thinks you have been visiting it before.
In the Java client bindings this would look like that:
Java
driver.get("http://edition.cnn.com/");
driver.manage().addCookie(new Cookie("CNNtosAgreed", "true", ".cnn.com", "/", null));
driver.get("http://edition.cnn.com/");
Notice how the first time Chrome navigates to the page, the confirmation dialog pops up, but not the second time.
Here are some examples of what the cookie API exactly looks like in Python: How to save and load cookies using python selenium webdriver

Oracle Apex workspace settings for multiple sessions for the same user account

Making Faster Navigation Between APEX Site-Designer Pages
I am having a few difficulties here as this may be a setting that I took for granted in other previous versions of Oracle APEX as before it may have been a default setting, but now the default has changed. Can anyone help me figure it out? I also explain why it was useful for me before...
How do you enable the Oracle APEX instance to permit logging in to the site-designer pages for a single workspace (Application Builder, SQL Workshop, Team Development modules, etc.) using the same user id through more than one browser window?
Note, I do this to save time from navigating between each section of the site-designer (even quick load times can slow down developing an application page or region because of constant shuttling back and forth to make small changes originally missing).
Example Use Case:
Oracle APEX Release: Application Express 4.2.6.00.03
Database Platform: Oracle 11g R2
Client-Agent(Browser): Firefox Release 33
Note, this was a fresh install from a lower version that was upgraded
several times up to the current APEX release.
LOG IN to Site-Designer with an account that has DEVELOPER or ADMIN level user privileges.
USE your own values for WORKSPACE, USER, PASSWORD.
CREATE a new PAGE level OBJECT (REGION, FORM, REPORT, etc.) and stop in the middle of the set-up wizard.
RIGHT-CLICK on a TOP LEVEL Menu item such as SQL WORKSHOP. Open it in a NEW WINDOW;
CREATE an object like a TABLE which can be used by the DESIGN WIZARD open in step 3.
The reason for trying to keep different browser sessions open for the same USER account allows users to go back to another section of the design tool to build other objects or app/page elements that were overlooked before initiating a design wizard process.
Observed Behavior:
The new session will allow the user to make a new database object, but when clicking back on the previous window with the session that is running the original wizard, the server prompts for a new log in because that session has been closed.
Thanks!
The solution I found when facing a similar situation was opening Apex in a couple of different web browsers in parallel, so i have Safari for the SQL workshop, and Chrome for the page designer..
so instead of ctrl-tab i use cmd-tab (or alt-tab for PC)
Our IT said it has something to do with session state..

IE8 losing session cookies in popup windows

We have an ASP.NET application that uses Forms Auth. When users log in, a session ID cookie and a Forms Auth ticket (stored as a cookie) are generated. These are session cookies, not permanent cookies. It is intentional and desirable that when the browser closes, the user is effectively logged out.
Once a user logs in, a new window is popped up using window.open('location here');. The page that is opened is effectively the workspace the user works in throughout the rest of their session. From this page, other pop-ups are also used.
Lately, we've had a number of customers (all using latest versions of IE8) complaining that the when they log in, the initial pop-up takes them back to the log in screen rather than their homepage. Alternately, users can sometimes log in, get to the homepage (which again, is in a new pop up window), and it all seems fine, until any additional pop-ups are created, where it starts redirecting them to the log in screen again.
In attempting to troubleshoot the issue, I've used good old Fiddler. When the problem starts manifesting, I've noticed that the browser is not sending up the ASP.NET session ID session cookie OR the Forms Auth ticket session cookie, even though the response to the log in POST clearly pushes down those cookies.
What's more strange is if I CTRL+N to open a new window from the popped-up window that is missing the session cookies, then manually type in the URL to the home page, those cookies magically appear again. However, subsequent window.open(); calls will continue to be broken, not sending the session cookies and taking the user to the log in screen.
It's important to note that sometimes, for seemingly no good reason, those same users can suddenly log in and work normally for a while, then it goes back to broken.
Now, I've ensured that there are no browser add-ons, plug-ins, toolbars, etc. are running. I've added our site as a trusted site and dropped the security settings to Low, I've modified the Cookie Privacy policy to "accept all" and even disabled automatic policy settings, manually forcing it to accept everything and include session cookies. Nothing appears to affect it.
Also note the web application resides on a single server. There is no load balancing, web gardens, server farms, clusters, etc. The server does reside behind an ISA server, but other than that it's pretty straight forward.
I've been searching around for days and haven't found anything actionable. Heck, sometimes I can't even reproduce it reliably. I have found a few references to people having this same problem, but they seem to be referencing an issue that was allegedly fixed in a beta or RC release (example: IE8 loses cookies when opening a new window after a redirect). These are release versions of IE, with up-to-date patches.
I'm aware that I can try to set permanent cookies instead of session cookies. However, this has drastic security implications for our application.
Update
It seems that the problem automagically goes away when the user is added as a Local Administrator on the machine. Only time will tell if this change permanently (and positively) affects this problem.
Time to bust out ProcMon and see if there is a resource access problem.
Update #2
It seems there are multiple angles to what appears to be a singular problem. I reported long ago that making the user a local administrator seemed to help. And it did, for a number of users. Of course, that's not really a solution, but it did let us hobble along.
Then more users started reporting the issue, and the admin fix was not helping. The users seemed to be mostly Win7, but Vista was also affected. They also seemed to mostly be 64-bit installations.
Setting the TabProcGrowth to 0 or 1 (either worked) as suggested by some members below seems to have largely addressed the issue. So, I'm going to move my accepted answer to the first person that suggested that, as it has had significantly more impact.
This has been an incredibly frustrating issue to attempt to solve, since it is difficult to reproduce and often occurs with users that I do not have direct communication with, or by the time I get to them it doesn't appear to be working. All I can say is something is not right with the session merging feature, but I don't have much data to feed to Microsoft to find a permanent fix.
This is 'new' functionality in IE8!
Checkj out the IE8 blog below to read about it.
http://blogs.msdn.com/askie/archive/2009/03/09/opening-a-new-tab-may-launch-a-new-process-with-internet-explorer-8-0.aspx
IE8 can use multiple processes for handling an x number of IE windows. When you cross a process space, you loose your cookies (Asp.Net session ID seems to be retained over this process boundry).
I personally think it's broken or a bug. As we know, when browing to the 'same domain target' cookies should be maintained and resent. That IE8 has different processing behavior for security.. Great! that it is behaving badly and 'drops cookies even if going to the same target domain in another window' is just a bug in my view.
You can modify the number of processes IE8 uses through the internet explorer options ehh.. modifying a registry setting!!!!!! (this is what makes it a bug in my view. IE providing a UI to modify these settings would make it 'enterprise level acceptable'.
Regard,
Marvin Smit
There are multiple possibilities behind this -
UAC & Vista (Had to crop up!!). Specifically, look for protected mode behavior.
This could be an actual problem with the Session Merging feature in IE8. More so because opening a new window via the Ctrl+N shortcut causes the cookies to be magically sent in your case.
An issue with an older build of IE (I know you have stated that your customers are using the latest build). You might want to check the details available at Microsoft Connect for bug IDs 408806 and 392032.
We solved this problem by changing the "Set tab process growth" to 0.
Although, we didn't have protected mode turned on and the zone was "Intranet". Evidently this is a problem/bug with Windows 7 64Bit as others have stated.
This page (#4) lead me to the solution: http://blog.httpwatch.com/2009/04/07/seven-things-you-should-known-about-ie-8/
Near as I can tell, another change to cookies across tabs just went live in this security update from November 12, 2013 that is breaking functionality in our app in all versions of IE. We're doing OpenID auth in a popup window so as to not have to redirect the user away from the page they were browsing when they first clicked the Login link. The session cookie for the login is correctly being sent down in the request in the popup window, but it never gets seen by the main browser window, so the next request to the server doesn't have that session cookie on it like it should, and thus logging in never actually works.
Does anyone have any possible solutions to this?
We had this problem on IE6,7 and 8 .The scenario is parent window(1) opens a modal window(2),modal window has a link to a non-modal window (3). I used to get a different session Id in the 3rd window.
Workaround mentioned here fixed the issue http://support.microsoft.com/kb/831678
Since IE8 we (and our customers) are also experiencing the same issue. We have an asp service for creating forms. This application uses new windows for adding elements or managing user accounts e.g. Randomly (when opening a new window), the application doesn't get the required session id for authentication allong with other 'permanent' cookies. Hence, the session id is a temporary cookie. Most of the time it goes well, but other times the session is broken every time a new window is opened. We have to advise our customers to close all IE windows and start over again.
As a web developer I use IE extensively. Personally, I am not experiencing the above issue. But I think a related one. A few times a day IE totally hangs (does not respond anymore) when opening a new window. When I kill a certain IE process using the task manager, IE starts responding again. But in most cases it's better to start all over with a clean new instance of IE. For this reason I just kill the process with the least ram usage which causes all IE processes to quit.
Microsoft saying these issues/bugs are squashed in the final version does not give me trust of their effort solving the issue still be experienced.
I also found a workable fix for this problem. There seems to be a problem with how IE8 handles opening servlets in another window with a relative path such as /test. It seems to be opening a new session as well as a new window. Our workable fix is that instead of opening a new window with a relative path, we just used a jsp page. So when we navigate to a URL, we do not navigate to /test anymore.We navigate to a specific file. In the jsp file, we forward the request to the relative path. This seems to work, which is kind of awkward, since the only difference is that we are placing a specific file in between.
I hope this helps.
I know this problem since IE 5, so I only use session's variables in modal pop-up windows...
When I open a non-modal pop-up window, I replace all session's variables with ASP.NET cache and new object collections...
But it's very tiresome!
Other browsers (i.e. Firefox) don't have this problem...
I believe this is actually a bug in IE; I have reported it here to see what feedback I get: http://social.msdn.microsoft.com/Forums/en-US/83bb3b91-1c1f-4d51-9281-9bc5f51d3640/log-in-fails-cookie-is-not-sent-to-originating-tab?forum=iewebdevelopment
I have a similar, though not identical problem. We load a webpage that opens a popup with window.open() into an IE browser control. On machines that have either IE6 and IE8, the popup window is always assigned a new SessionID by ASP when launched from the control. However, when launched from a normal browser (IE or Firefox), the popup window gets the existing SessionID.
I can see when launching from the control that a new iexplore.exe process is spawned; thus the session loss behavior makes sense given what has been mentioned about in-memory cookies not being carried over to the new process.
I'm still trying to figure out a workaround myself ...
Update
Figured out a workable fix! It is possible to subclass SessionIDManager and specify that this class should be used instead of the default (<sessionState sessionIDManagerType="..."> in Web.config). The subclass can look for a query parameter containing the existing session id in an override of CreateSessionID(), and return it if found. This essentially allows a page to request being "merged" into an existing session it has knowledge of.
The call to window.open() then simply needs that query parameter specified in its URL.
Haw-Bin
Had a similar problem with PHP5 and IE8. When opening one certain popup window in Javascript with window.open, IE8 lost the session cookie and forced the user to login agan.
Meanwhile, other popup windows worked OK.
The culprit turned out to be an image tag. The template system generates image src = values dynamically and a missing image resulted in an image tag with an empty src clause (
I supect this has something to do with IE interpreting the empty src-tag as an insecure URL and isolating the session in the popup without informing the user.
I was running into a similar issue with using session variables to pass values to a pop-up window. I just ended up writing the values to a persistent cookie and then reading the cookie in the popup window. This may not work with the issue you were having with forms authentication, but if are just using session variables to pass some values to a window in IE8, persistent cookies seems to have worked for me.
edit: see also this thread
You Can Also Use the LocalStoprage method to reset the value in parent window.
localStorage("Key")="Value";//Javascript