unique id of window tab in web browser
Moderator: General Moderators
unique id of window tab in web browser
i wanna ask if there is a unique id for each window tab in web browser? how to obtain it in php?
my problem is, i wanna redirect people that tracked by $_SESSION. But this will only works if he use one window tab to browse the page.
thanks
my problem is, i wanna redirect people that tracked by $_SESSION. But this will only works if he use one window tab to browse the page.
thanks
Re: unique id of window tab in web browser
You can't do that. Find another way.
Re: unique id of window tab in web browser
hm...
any suggestions about technique to redirect url?
or any one know how this devnetwork forum redirect when you have submit a reply then return to the topic?
thanks
any suggestions about technique to redirect url?
or any one know how this devnetwork forum redirect when you have submit a reply then return to the topic?
thanks
Re: unique id of window tab in web browser
The typical way of redirecting people is to execute
before you've printed anything.
If you explain a little more about what you want to do maybe we'll understand why "this will only works if he use one window tab to browse the page".
Code: Select all
header("Location: /url");
exit;If you explain a little more about what you want to do maybe we'll understand why "this will only works if he use one window tab to browse the page".
-
alex.barylski
- DevNet Evangelist
- Posts: 6267
- Joined: Tue Dec 21, 2004 5:00 pm
- Location: Winnipeg
Re: unique id of window tab in web browser
From what I have determined in javascript...tabs do not behave the same as windows at least IE.
I was experiementing with a web desktop I was developing and one of the things I wanted to do was use the desktop system tray icons essentially re-display the tab which represent that application.
While storing the window ID in IE worked as soon as I switched to tab mode the window.setfocus() or whatever function called to bring a window to the front stopped working. I believe I tried this in FF, OP and Safari as well with no success. Kind of bummed me out cause the idea was really neat.
Although technically it makes some sense as a tab, is not nessecarily a "window" in that sense of the word.
I was experiementing with a web desktop I was developing and one of the things I wanted to do was use the desktop system tray icons essentially re-display the tab which represent that application.
While storing the window ID in IE worked as soon as I switched to tab mode the window.setfocus() or whatever function called to bring a window to the front stopped working. I believe I tried this in FF, OP and Safari as well with no success. Kind of bummed me out cause the idea was really neat.
Although technically it makes some sense as a tab, is not nessecarily a "window" in that sense of the word.
Re: unique id of window tab in web browser
this is what i'm trying to do
example i would reply a post on topic A, let say with tab 1.
On tab 1, after i reply a topic, it will be redirect to the topic A url.
I do this using session value. This value is saved when i visit topic A.
But in the same time if i want to reply topic A, if theres also opened tab 2 that i would like to reply a post on topic B, the session will be overwritten isnt it?
so the redirection will be failed.
Thanks
example i would reply a post on topic A, let say with tab 1.
On tab 1, after i reply a topic, it will be redirect to the topic A url.
I do this using session value. This value is saved when i visit topic A.
But in the same time if i want to reply topic A, if theres also opened tab 2 that i would like to reply a post on topic B, the session will be overwritten isnt it?
so the redirection will be failed.
Thanks
-
alex.barylski
- DevNet Evangelist
- Posts: 6267
- Joined: Tue Dec 21, 2004 5:00 pm
- Location: Winnipeg
Re: unique id of window tab in web browser
SESSION's are as good as their client side persistence mechanism used...
If SESSION ID's are stored in cookies then tabs will work fine I do this all the time on these boards with no issues...open a topic in a new window and reply that is.
If SID is propagated via GET then opening a new window would require you to pass along the SID with the window.open request.
If SESSION ID's are stored in cookies then tabs will work fine I do this all the time on these boards with no issues...open a topic in a new window and reply that is.
If SID is propagated via GET then opening a new window would require you to pass along the SID with the window.open request.
Re: unique id of window tab in web browser
i dont understand >.<PCSpectra wrote:SESSION's are as good as their client side persistence mechanism used...
If SESSION ID's are stored in cookies then tabs will work fine I do this all the time on these boards with no issues...open a topic in a new window and reply that is.
If SID is propagated via GET then opening a new window would require you to pass along the SID with the window.open request.
is the session id of each tab is different?
here's my example on using the redirection:
topic_detail.php
Code: Select all
<?php
session_start();
$_SESSION['lastURL'] = getThisURL();
?>
<a href='write_reply.php?id=1'>Write reply</a>
Code: Select all
<?php
session_start();
//do processing...
header("Location: redirect.php");
?>
Code: Select all
<?php
session_start();
if( isset($_SESSION['lastURL']) ){
header("Location:" . $_SESSION['lastURL']);
}
?>
Re: unique id of window tab in web browser
Just read about interesting related technology. I'm sure if you google http Sub-Sessions for different tabs you will find some answers. Url rewriting allows multiple sessions.
Re: unique id of window tab in web browser
i thought about window.name property to handle this problem.
i think, i could assign each tab with unique window.name, that may be generated by timestamp or something.
so i could add session value with prefix + window.name
any suggestions?
i think, i could assign each tab with unique window.name, that may be generated by timestamp or something.
so i could add session value with prefix + window.name
any suggestions?