You are here: Re: Session variables persistency « All PHP « IT news, forums, messages
Re: Session variables persistency

Posted by Erik Kullberg on 10/18/07 22:32

See http://kueng.se/session_test/page1.php

As you can see everything works fine as long as you can get back by use of a
link. If there is no link (so you have to get back the hard way) the session
ID will be destroyed.
Do you know of a cure for this?
/ Erik


"yakuza" <xentraz@hotmail.com> skrev i meddelandet
news:1192717259.539807.40700@i38g2000prf.googlegroups.com...
don't know wat u want exactly but you can set session to expire after
a certain time even if browser is closed

session_cache_expire(10); // set to expire after 10 mins
session_start();
$_SESSION['run_id']=time();
if (!isset($_SESSION['run_id'])) {$_SESSION['run_id']=time();}

---- when do you want session destroyed, after what effect?




Yakuza
-----------------------
???????
http://www.samamanda.com


On Oct 14, 12:24 pm, "Erik Kullberg" <erik.kullb...@telia.com> wrote:
> I have an "index.php" page, near the top of which this line
>
> if (!isset($_SESSION['run_id'])) {$_SESSION['run_id']=time();}
>
> produces a persistent run id. I can close that page and - as long as I do
> not close the browser - I can come back and continue from where I was,
> thanks to the session administration. It works fine.
>
> A bit down on the same page I have the following sequence - a link,
> disguised as a button:
>
> <FORM METHOD="GET" ACTION="./Documentation/users_guide.php"
> style="border-style:solid; border-width:0px; border-color:black;
> padding:5px; margin:0px;" TARGET="_blank">
> <INPUT TYPE=SUBMIT Value="User΄s Guide" style="color: maroon;
> font-family:Times New Roman; font-size: 12px; font-weight: bold;
> width:90px; height:25px; padding-bottom: 0; " >
> </FORM>
>
> The page "users_guide.php" is quite plain - no interaction with user or
> anything else. It does not use any session variables. It opens quite ok.
> To close it I use the cross in the upper right corner (Windows).
>
> But ... When I come back to "index.php", I get
>
> isset($_SESSION['run_id'])=FALSE
>
> and thereby a new run id!
>
> I have a number of "fake buttons" like this on that page and they all have
> the same effect on the run id. In one of them the addressed page actually
> uses the run id. That works ok, so I know it was not destroyed before the
> button was pressed.
> By the way - if I use a simple link instead, the run id is persistent as
> it should be.
>
> Any idea of how I can get around this (without going back to simple
> links - they don't look nice)?
>
> / Erik

 

Navigation:

[Reply to this message]


УдалСнная Ρ€Π°Π±ΠΎΡ‚Π° для программистов  •  Как Π·Π°Ρ€Π°Π±ΠΎΡ‚Π°Ρ‚ΡŒ Π½Π° Google AdSense  •  England, UK  •  ΡΡ‚Π°Ρ‚ΡŒΠΈ Π½Π° английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Π‘Π°ΠΉΡ‚ ΠΈΠ·Π³ΠΎΡ‚ΠΎΠ²Π»Π΅Π½ Π² Π‘Ρ‚ΡƒΠ΄ΠΈΠΈ Π’Π°Π»Π΅Π½Ρ‚ΠΈΠ½Π° ΠŸΠ΅Ρ‚Ρ€ΡƒΡ‡Π΅ΠΊΠ°
ΠΈΠ·Π³ΠΎΡ‚ΠΎΠ²Π»Π΅Π½ΠΈΠ΅ ΠΈ ΠΏΠΎΠ΄Π΄Π΅Ρ€ΠΆΠΊΠ° Π²Π΅Π±-сайтов, Ρ€Π°Π·Ρ€Π°Π±ΠΎΡ‚ΠΊΠ° ΠΏΡ€ΠΎΠ³Ρ€Π°ΠΌΠΌΠ½ΠΎΠ³ΠΎ обСспСчСния, поисковая оптимизация