Re: Problem with sessions.
| From: | Tom Rogers | Date: | Sun, 17 Mar 2002 13:01:19 +0000 |
| Subject: | Re: Problem with sessions. | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-88824@lists.php.net to get a copy of this message | ||
hi
If you put:
<?
session_start();
as the first line on your page it will behave as you want I think.
Tom
At 08:41 PM 17/03/2002, Carlos Costa Portela wrote:
On Sat, 16 Mar 2002, Edward van Bilderbeek - Bean IT wrote: maybe you better use: session_unregister("counter");I've put that, but it doesn't run. As you can see in the URLsbelow, my code is: if ($id == "logout") { // the user wants logout :(session_unregister("counter");} else { // user is navigating through our linkssession_register("counter"); // why I recover the previous value here, // even I've clicked logout? $counter++; print "counter: $counter<br/>\n";} }http://casa.ccp.servidores.net/tutorials/php/sessions/sessions.php and http://casa.ccp.servidores.net/tutorials/php/sessions/sessions.phps you have the web page and the code, respectively.Tom says that I must create a new session with a different name(now I only start a new session implicitly via session_register()). Perhaps I am confused with the 'session' term. I thought that if I do session_destroy() the session forget all the info, but if I check session_id() before and after session_destroy() I see that the value is the same.Thanks for your help, Carlos._______Carlos Costa Portela_________________________________________________ | e-mail: ccosta@servidores.net | home page: http://casa.ccp.servidores.net | |_____Tódalas persoas maiores foron nenos antes, pero poucas se lembran______|