473,797 Members | 3,174 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

session & browsers (final)

I ask something relative later but the answer make me cry ;-)
If we duplicate the browser window (both in IE / Mozilla), both of 2 browser windows use the same session!!!
This produces many problems...

My program is this:
I have html format books inside zip files.
If I choose a book from my main page, php sets
$_SESSION['book'] = "a_book.zip ";
and loads the index.html from a_book.zip.
if we click a link inside index.html like:
<a href=chapter1.h tml>Next</a>
Apache returns error 404, php handles this error and returns file chapter1.html from a_book.zip

All right but the problem is this:
If I duplicate browser window and in the 2nd browser I select another book, then because both of 2 browser use the same session, 2nd
browser change the $_SESSION['book'] and 1st browser searches in wrong zip file.

Any suggestions?

Regards
Gessos Paul

Jul 17 '05 #1
6 2216

"<- Chameleon ->" <ch******@hotma il.NOSPAM.com> a écrit dans le message de
news: bn**********@ni c.grnet.gr...
I ask something relative later but the answer make me cry ;-)
If we duplicate the browser window (both in IE / Mozilla), both of 2 browser windows use the same session!!! This produces many problems...

My program is this:
I have html format books inside zip files.
If I choose a book from my main page, php sets
$_SESSION['book'] = "a_book.zip ";
and loads the index.html from a_book.zip.
if we click a link inside index.html like:
<a href=chapter1.h tml>Next</a>
Apache returns error 404, php handles this error and returns file chapter1.html from a_book.zip
All right but the problem is this:
If I duplicate browser window and in the 2nd browser I select another book, then because both of 2 browser use the same session, 2nd browser change the $_SESSION['book'] and 1st browser searches in wrong zip file.
Any suggestions?

Regards
Gessos Paul


sorry for makin' you cry :)

for your problem, maybe you should try to use a random ID (or book name if
unique) for each search made on your Zip or something like that.
You should add something in your session to identify which book you're
using.
something like :
$book["RANDOM_ID"]["BOOK"]
$book["RANDOM_ID"]["OTHER_VAR_RELA TED_TO_THIS_BOO K"]

You'll need to write a script to manage those vars and crush the session
var.

hope it'll help
Regards,
Julien.

Jul 17 '05 #2
> > I have html format books inside zip files.
If I choose a book from my main page, php sets
$_SESSION['book'] = "a_book.zip ";
and loads the index.html from a_book.zip.
if we click a link inside index.html like:
<a href=chapter1.h tml>Next</a>
Apache returns error 404, php handles this error and returns file chapter1.html from a_book.zip

All right but the problem is this:
If I duplicate browser window and in the 2nd browser I select another

book, then because both of 2 browser use the same session, 2nd
browser change the $_SESSION['book'] and 1st browser searches in wrong zip file.

for your problem, maybe you should try to use a random ID (or book name if
unique) for each search made on your Zip or something like that.
You should add something in your session to identify which book you're
using.
something like :
$book["RANDOM_ID"]["BOOK"]
$book["RANDOM_ID"]["OTHER_VAR_RELA TED_TO_THIS_BOO K"]

You'll need to write a script to manage those vars and crush the session
var.


Thank you for your response, but I don't understand. Sorry ;-(
first of all book name is unique. I have 2 browser windows:
1st has $_SESSION['book'] = 'php_manual.zip '
2nd overide $_SESSION['book'] = 'thinking_in_cp lusplus.zip' because has the same session
so when 1st gets image: image.jpg from an <A> tag, php search inside 'thinking_in_cp lusplus.zip' and not inside 'php_manual.zip '

You suggest $_SESSION['book'] will be an array? How it help?
thank you
Jul 17 '05 #3
On Thu, 30 Oct 2003 17:38:18 +0200, <- Chameleon -> wrote:
Thank you for your response, but I don't understand. Sorry ;-(
first of all book name is unique. I have 2 browser windows:
1st has $_SESSION['book'] = 'php_manual.zip '
2nd overide $_SESSION['book'] = 'thinking_in_cp lusplus.zip' because has the same session
so when 1st gets image: image.jpg from an <A> tag, php search inside 'thinking_in_cp lusplus.zip' and not inside 'php_manual.zip '

You suggest $_SESSION['book'] will be an array? How it help?
thank you


He's saying that you need to use a unique identifier for each book OTHER
than the generic name 'book'. (Also note that the session for a browser
and ALL of its open windows is the same session.)

So if book names are unique, track the book by using the name of the book,
instead of the very generic variable name "$book".

Something like

$_SESSION['book_list']['a_book'] = 'a_book_file.zi p';
$_SESSION['book_list']['b_book'] = 'b_book_file.zi p';
$_SESSION['book_list']['c_book'] = 'c_book_file.zi p';

etc...

That makes an array $_SESSION['book_list']. Use that array to keep all
the books in one place, but use a different key for each book, in this
case the key is the book's name.

Hope this helps. If not, then learn more about Arrays, Multi-dimensional
arrays, Associative arrays, and Sessions. Go to
http://www.php.net/manual/ for that.

later...
--
Jeffrey D. Silverman | jeffrey AT jhu DOT edu
Johns Hopkins University | Baltimore, MD
Website | http://www.wse.jhu.edu/newtnotes/

Jul 17 '05 #4
> He's saying that you need to use a unique identifier for each book OTHER
than the generic name 'book'. (Also note that the session for a browser
and ALL of its open windows is the same session.)

So if book names are unique, track the book by using the name of the book,
instead of the very generic variable name "$book".

Something like

$_SESSION['book_list']['a_book'] = 'a_book_file.zi p';
$_SESSION['book_list']['b_book'] = 'b_book_file.zi p';
$_SESSION['book_list']['c_book'] = 'c_book_file.zi p';

etc...

That makes an array $_SESSION['book_list']. Use that array to keep all
the books in one place, but use a different key for each book, in this
case the key is the book's name.

Hope this helps.


Thank you but it is wrong ;-)
Wrong because you want a key (the book's name).
Where can I store this key? In Session? In this case we fall in the start of the problem.
I cannot use GET, POST & COOKIE
Jul 17 '05 #5
On Thu, 30 Oct 2003 21:44:33 +0200, <- Chameleon -> wrote:
Thank you but it is wrong ;-)
Wrong because you want a key (the book's name).
Where can I store this key? In Session? In this case we fall in the start of the problem.
I cannot use GET, POST & COOKIE


You lost me there. Why can't you store the book's name in a session?
--
Jeffrey D. Silverman | jeffrey AT jhu DOT edu
Johns Hopkins University | Baltimore, MD
Website | http://www.wse.jhu.edu/newtnotes/

Jul 17 '05 #6
> > Thank you but it is wrong ;-)
Wrong because you want a key (the book's name).
Where can I store this key? In Session? In this case we fall in the start of the problem.
I cannot use GET, POST & COOKIE


You lost me there. Why can't you store the book's name in a session?


because 2nd browser windows which points in other book will overide 1st browser book's name.

anyway, I found other method to accomplish:
Until now I dont knew that:
I can pass data with GET with this:
book.php/thinking_in_cpl usplus.zip/index.html

All are easy now

thanks
Jul 17 '05 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
3936
by: | last post by:
>> When I open a second browser window from the first, it uses the same session with first!!! > This is not true. session_id is unique for each combination of browser/url. I believe this too, but you can see: 1. try http://tassadar.physics.auth.gr/~chameleon/Books/ 2. right-click in one menu link and "open in new window". 3. in 2nd browser window click greek flag 4. in 1st browser window click "Programming" everything in 1st browser...
0
14721
by: Maverick | last post by:
Hello all, I read some good reviews about jakarta HTTPClient about its session and cookies management system and fancied giving it a try as a learning exercise but somehow I don't seem to be able to get it to work properly. I'm basically trying to connect to this site http://s1.starkingdoms.com/scripts/main.php I am able to get past the authentication login page onto the next screen but I then can't proceed any further because of...
8
2541
by: Patrick | last post by:
Hi I am in the process of learning javascript and was wondering how often the web professionals update I.E & N.N? I mean do you religiously wait for the next upgrade and download it ASAP when available or do you upgrade only between main version and don't worry about minor updates? I currently have I.E 6.0.2600 & N.N 6.2.3 Latest I.E. is 6.0 (SP1) Latest N.N. is 7.1
5
8704
by: Jukka K. Korpela | last post by:
The HTML specifications define the entities &zwj;, &zwnj;, &lrm;, &rlm; as denoting zero-width joiner, zero-width non-joiner, left to right mark, and right to left mark. Is there any evidence of any browser support to the characters so denoted, in the sense defined in the Unicode standard, chapter 15? ( &zwj;, &zwnj;, &lrm;, &rlm; ) For example, does f&zwj;i ever produce an fi ligature? In my tests, the best I get is that the characters...
17
7264
by: Torbjørn Pettersen | last post by:
I've got a table where I want some of the cells to use a background image. The cells have variable height, so I am using an image with a rather small height to fill up the background of the cells, thus making I look like one high image in there. When validating it, I get this error: there is no attribute "BACKGROUND" The validators also tell me there are no "HEIGHT" or
19
4024
by: Mel | last post by:
when downloading files from my site, when file types are known (i.e *.doc) browsers open the file for viewing. is there a way to disable that and just present the save as dialog (same as for unknown types zip files etc.) ? thanks Mel
4
2766
by: Chris | last post by:
When a request comes into a page on my ASP.net site and a session is not found, I want to detect whether the request is an initial request or if the user did have a session going that has now been lost and show an explanatory message before restarting the session. Rather than tagging a 'session in progress' flag on the end of every request querystring I'd like to detect it using data sent in every request. One idea I had was that when...
0
2512
by: YellowFin Announcements | last post by:
Introduction Usability and relevance have been identified as the major factors preventing mass adoption of Business Intelligence applications. What we have today are traditional BI tools that don't work nearly as well as they should, even for analysts and power users. The reason they haven't reached the masses is because most of the tools are so difficult to use and reveal so little
1
4225
by: littlealex | last post by:
IE6 not displaying text correctly - IE 7 & Firefox 3 are fine! Need some help with this as fairly new to CSS! In IE6 the text for the following page doesn't display properly - rather than being aligned to the top, along with the slideshow and link buttons, you have to scroll down to see the text - how can I make IE6 display correctly? http://geekarama.co.uk/new_home.html here is the code for new_home.html and following that the CSS...
0
9685
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
1
10205
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
1
7559
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6802
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5458
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5582
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4131
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3748
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2933
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.