I have below scenario
www.site1.com is opened in one browser window/tab (Which is my website)
www.customersite.com, opened in another browser which is client website.
I have full control over site1.com and I can give a script to embed in the www.customersite.com.
I wanted to inform www.customersite.com whenever www.site1.com is opened in another window. And when www.customersite.com gets to know that www.site1.com is opened, it will transmit some data to mysite1 server
I tried https://github.com/pubkey/broadcast-channel but it is only working when both the window are from same origin.
Is there a any way i can achieve this communication? Is there a way to identify site1.com is opened in another window?
If this is not possible is there amy other way to achieve the same?
Related
I develop a site where certain pages a user can only access when he is logged in.
For certain requests I would be better when I open new window. Mostly I use the session to store data including the user data.
To open a new window I use:
ScriptManager.RegisterStartupScript(this, typeof(string), "OpenWindow",
"window.open( '~/smsftd1', null,'height=400,width=600, status=yes,
toolbar=no, menubar=no,location=no' );", true);
It opens the window and it looks how I want it and how it should behave. The only downside is that all data I have saved with the session variables are gone.
If I redirect in the same pages or even open a new tab it works fine and all session variables are available.
When I search for the issue it was pointed out it is an IE issue (older versions). I changed the settings in the IE browser settings but it did not help.
The main issue is that I loose the authorisation the user made.
At the moment I removed to opening of a new window and just redirect.
If someone has done this I wish to know so I can organise a better flow.
The only option I could think of is storing data in a cookie instead of the session.
Any feedback please?
There is no direct answer, but you can check with fiddler or trash tool in firefox.
Please increase your session timeout.
Also check in global.aspx, that there is no event call when new window open.
The best thing is fiddler to check where you all history show about what are the cookie/session variable, link to redirect etc.
Please this link before doing anything.
After a few window.open calls my ASP.NET session times out
http://bytes.com/topic/asp-net/answers/287080-session-variable-window-open
Keeping ASP.NET Session Open / Alive
Add in web.config and try(reference from above link)
"<httpHandlers>
<add verb="GET,HEAD" path="SessionHeartbeat.ashx" validate="false" type="SessionHeartbeatHttpHandler"/></httpHandlers>"
In my web application I get some data from server. Then if user want's to see this data visualized in great detail I want to open second browser window and do it there. The problem is with passing the data to be visualized. I don't want to make second request to server. So all I have now is to append this data to the URL to be opened in second window. This of course works but the URL look ugly and the amount of data is very limited. Is there any other way to accomplish this?
You could use a session-value. Save the data into the session when retrieving it from the server, and read it when you open the second browser tab.
I m currently building a facebook style notification system for my site.
I m using long polling. So, the server sends data if its available and closes the connection.
Now the problem i m facing is that, i want it to share across all open tabs or windows of that browser.
I m using a cookie to detect if a tab is already executing the ajax call, so other tabs will not execute it until the operation of the first tab is complete.
Now what i want is, to have an effective way, so that i can show the data across all open tabs in the form or a small fb style popup box.
The goal is if the last active ajax call has some data, then a small popup box will show up on all open browser tab or windows.
As, a theory i may be able to do it via cookie, but i want to know if there is some better way to do that.
Thanks,
Anjan
Browsers don't let pages talk to other pages. You'd have to make an extension to get around the cookie.
If you're ok with the cookie idea, follow these examples:
For client side access
For PHP access
For NodeJS
suppose one user logins to a web site and start navigating its pages.
For a specific page, he copies page address and pastes it to a new IE window address bar.
Now, what happens to his session? Does it duplicates? or what?
No, AFAIK, the SESSION cookie gets sent to the browser (the application as a whole, not the window). Each window references the same cookie information held by the browser (IE).
An oversimplified example:
Think of it as a database and a script. The database houses a bunch of information, which can be read by many scripts. That information is still housed in one place even though every script can do something with it.
The session cookie would be the database and the browser window the script.
I think it goes like this:
If the "new window" is opened with Ctrl-N in the first window, the same session exists in the "new window".
If the "new window" is opened by double-clicking on the IE icon, the first window's session doesn't come along for the ride.
Independent of the browser a new window or tab of the same browser uses the same session. Only another process will have a different session. For example copy the address to another browser like Firefox, and you will get a new session.
Opening a new window within the same browser is no different from the server's point of view than reloading the page in the current window. The session is the same and the server merely issues a response to the request. However if there were any POSTed fields in the original page request (for example, the user had performed some actions) these will not be sent with the new request.
Sessions are created and destroyed by the web browser on the server. So sessions are unique for each browser. That is no need to re-generate when using the same browser (if not log out)and need to re-generate when using a different browser from the first one. Therefore if copying the URL to the same browser before closing the current window, then it is same as the earlier session. But not if copying to a different browser, and in this case you will ask to log in again.
However if you have set the session to be closed when window is closed, then closing the browser will close the session and but closing the tab will not close the session because server keeps that browser is still live and then keep the session live.
I have to develop an application to monitor Safari activity like all open url , tabs on particular window and loding time of particular url.
I also need to track online streaming that is happening on particular opened htmm page
URL of streaming source, which player is being used for streaming and all other basic information which opened page contains.
I have to develop an application to monitor Safari activity like all open url , tabs on particular window and loding time of particular url.
You can ask Safari for the first two things via AppleScript; the latter is in the Element Inspector, but I'm not sure why you would want it in another application.
I also need to track online streaming that is happening on particular opened htmm page
That's a separate question, so you should post it separately.