Rujan 05, 2010, 08:55:10
News: Opet je uradjen upgrade foruma na zadnju verziju.  Pozdravlja vas poglavica sindikata.
 Str: [1]
Ispis
Autor Tema: izgubim session kad otvorim novi prozoe u IE?  (Posjeta: 1075 puta)
afan
Global Moderator
Pentium III
*****
Offline Offline

Postova: 2205



Profil WWW
« na: Oľujak 26, 2008, 08:16:16 »

nije bas "direktno" vezan za M$, ali posto je IE njihov proizvod - nadam se da sam natakario ovu temu na pravo mjesto Sirast

na jednoj stranici imam listu ljudi. ime, prezime, broj... kad kliknes na "detalj" otvori se novi prozor (target="_blank") sa vise detalja o toj osobi.
problem je sto nekolicinii korisnika (svi IE) kad kliknu na "detalj" dobiju "error page" u drugom prozoru jer id osobe ije poznat i bla, bla, bla... a nista nije poznato jer se cijeli session izgubi?!? U stvari, novi prozor starta kao novi proces i novi session ID i sve ostalo totalno posebno?
e, interesuje me kako da to popravim?

hajd' vienna, ti navijas za M$ i IE, ti bi mor'o znati Sirast Sirast Sirast
Evidentirano

Uzdaj se use, use i u openSuse
Dino L.
Administrator
Itanium 2
*
Offline Offline

Postova: 4653


public class Dino L. : Insan.Musko.bh


Profil WWW
« Odgovor #1 na: Oľujak 26, 2008, 08:33:51 »

Koristis li session_start() u novom prozoru?

Nema mi logike ako se browser otvori kao dijete drugog da izgubi sesiju
Evidentirano

Mellita, domi adsum.
Lava nisam jeo, al za mene je janje kralj ?ivotinja.
Dino L.
Administrator
Itanium 2
*
Offline Offline

Postova: 4653


public class Dino L. : Insan.Musko.bh


Profil WWW
« Odgovor #2 na: Oľujak 26, 2008, 08:35:42 »

pufff

Citat:
Chris Brown
24-Apr-2007 04:17
Here's another session tip for you, relevant to IE6:

If you find that your session is unexpectedly lost when your application opens a page in a pop-up window, try closing down any other copies of IE running on your machine.

The problem is that IE doesn't always use the same IE process to host a new pop-up window - it chooses one (using some mysterious strategy) from the pool of running IE processes! Since session information (cookies) is not preserved across processes, the pop-up may loose the session (and probably redirect the user to your log-in page.)

I don't know a work-around for this, except for close all other IE windows. Microsoft state that they do not guarantee that sessions will be preserved across multiple windows: http://http://support.microsoft.com/default.aspx/kb/196383

ali evo sa php.net

Citat:
If you open a popup window (please no commercial ones!) with javascript window.open it might happen IE blocks the session cookie.
A simple fix for that is opening the new window with the session ID in a GET value. Note I don't use SID for this, because it will not allways be available.

----page.php----
//you must have a session active here
window.open('popup.php?sid=<?php echo session_id(); ?>', '700x500', 'toolbar=no, status=no, scrollbars=yes, location=no, menubar=no, directories=no, width=700, height=500');

----popup.php----
<?php
session_id(strip_tags($_GET['sid']));
session_start();
//and go on with your session vars
?>
« Zadnja izmjena: Oľujak 26, 2008, 08:38:43 do Dino L. » Evidentirano

Mellita, domi adsum.
Lava nisam jeo, al za mene je janje kralj ?ivotinja.
afan
Global Moderator
Pentium III
*****
Offline Offline

Postova: 2205



Profil WWW
« Odgovor #3 na: Oľujak 26, 2008, 09:48:41 »

Koristis li session_start() u novom prozoru?

Nema mi logike ako se browser otvori kao dijete drugog da izgubi sesiju

da, koristim.
pazi, ovo se desava samo nekima (par postotaka) i to sam ona IE. tako da nekad kontam da to nije do njihovog IE setinga?
Evidentirano

Uzdaj se use, use i u openSuse
afan
Global Moderator
Pentium III
*****
Offline Offline

Postova: 2205



Profil WWW
« Odgovor #4 na: Oľujak 26, 2008, 09:58:00 »

Citat:
Chris Brown
24-Apr-2007 04:17
Here's another session tip for you, relevant to IE6:

If you find that your session is unexpectedly lost when your application opens a page in a pop-up window, try closing down any other copies of IE running on your machine.

The problem is that IE doesn't always use the same IE process to host a new pop-up window - it chooses one (using some mysterious strategy) from the pool of running IE processes! Since session information (cookies) is not preserved across processes, the pop-up may loose the session (and probably redirect the user to your log-in page.)

I don't know a work-around for this, except for close all other IE windows. Microsoft state that they do not guarantee that sessions will be preserved across multiple windows: http://http://support.microsoft.com/default.aspx/kb/196383

problem je sto ja ne mogu kreirati ovaj problem kod sebe. sve radi kako treba. ali je ovo dobroznati.

Citat:
If you open a popup window (please no commercial ones!) with javascript window.open it might happen IE blocks the session cookie.
A simple fix for that is opening the new window with the session ID in a GET value. Note I don't use SID for this, because it will not allways be available.

----page.php----
//you must have a session active here
window.open('popup.php?sid=<?php echo session_id(); ?>', '700x500', 'toolbar=no, status=no, scrollbars=yes, location=no, menubar=no, directories=no, width=700, height=500');

----popup.php----
<?php
session_id(strip_tags($_GET['sid']));
session_start();
//and go on with your session vars
?>

hm. ideja slanja session id preko URL-a mi se ne svidja ni najmanje Tu&#382;an

Evidentirano

Uzdaj se use, use i u openSuse
afan
Global Moderator
Pentium III
*****
Offline Offline

Postova: 2205



Profil WWW
« Odgovor #5 na: Oľujak 26, 2008, 11:09:00 »

izleda da sam uspio generisati problem kao i tih par ljudi - ali ne znam da li ovo isto prarvi njima problem:
IE7 >  Tools > Internet Options > Privacy: Setting postaviti na High ili Block all cookies.
?!?
Evidentirano

Uzdaj se use, use i u openSuse
 Str: [1]
Ispis
Skoči na: