Reply to setting multiple PHPSESSID durations - asking for trouble?

Your name:

Reply:


Posted by zorro on 06/13/06 15:25

Greetings,

I want users to select the duration time of their sessions. I'm able to
do it by setting the PHPSESSID cookie duration. Is this reliable, or is
it not recommended for some reason?

This is the test :
open browser, close browser, reopen browser

if( ! $_COOKIE["PHPSESSID"]) // opened browser first time - no session
{
// create a session
session_start();

// modify cookie duration
myCookieAdd("PHPSESSID",session_id(), $userSelectedNbHours);

// set some variable
$_SESSION["bozo"]='clown';

}
else // reopened browser - cookie still exists, variable still exists
{
session_start();
echo $_SESSION["bozo"]; // prints "clown"
}

any thoughts?

[Back to original 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

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация