$_SESSION varibles not being removed...



  • 1. UPS class failing
    I found a neat piece of code for calculating UPS shipping ...but I think it might be out of date, because the last three product codes return zero when I run them into the quote function. Has UPS just changed their codes? Sorry this isn't exactly PHP-specific, but I looked at the UPS site and they don't seem to publish this info. I kind of assumed there were enough pros in here that someone could point me in the right direction. function upsProduct($prod){ /* 1DM == Next Day Air Early AM 1DA == Next Day Air 1DP == Next Day Air Saver 2DM == 2nd Day Air Early AM 2DA == 2nd Day Air 3DS == 3 Day Select GND == Ground STD == Canada Standard XPR == Worldwide Express XDM == Worldwide Express Plus XPD == Worldwide Expedited */ $this->upsProductCode = $prod; }
  • 2. cookies and standard/quirk mode
    I want to set a cookie but from what I have found out you can't send anything to the browser before the cookie is set or it doesn't work - same for headers function. So, if that is the case, how do I send the dtd stuff that goess before the html element? If I send nothing at all the page will not be in standard mode and I don't want my page to be in quirk mode. thanks David
  • 3. Reading code from file/database and running it, a further question.
    Hi again, I am using eval(...) to run some code that i get from the database. But in fact i get the whole html from the database so what i get is something like $code = " <html> <?php print( 'Hello world' ); ?> </html>"; In that case, eval($code ), does not work. I have written a small function that replaces the text $code $code = ' print( "<html>"); print( 'Hello world' ); print( "</html>");'; and that seems to work, but is very unstable, (especially if you use <?php, <?, <?=, or <script). So i was wondering if there is a better way of acheiving what i want? That is to pass an HTML code with some php in it? Regards. Sim
  • 4. problem - 2 session id's at once causes loss of session
    I've been having a very weird problem for a while now. About 1% of the time, people lose their sessions. Through logging I have discovered that a lot of these people are getting 2 conflicting session id's. What is throwing me for a loop is this: Lets call the session id's aaaaa and bbbbb session_name() is standard, "PHPSESSID" session_id() is aaaaa the URL contains no session info the session cookie $_COOKIE[session_name()] is bbbbb $_POST[session_name()] is bbbbb So how on earth did session_id() get set to aaaaa? Is session_start() somehow ignoring the cookie? I'm using the latest release, php 4.3.4

$_SESSION varibles not being removed...

Postby Domestos » Fri, 07 Oct 2005 04:52:30 GMT

Consider this...

Page1.php  - calls session_start();
Page2.php - calls session_start(); and sets $_SESSION['user']
Page3.php - does not call session_start();
Page4.php - calls session_start(); and displays $_SESSION['user']

Each page is accessed sequentially
Is that correct?  should $_SESSION['user'] still be available in page4.php 
even though page3.php did not call session?
Or am I mistaking how sessions work? I thought you had to keep calling them 
on every page else the SESSION varibales would be lost.

Andrew Makinson

Re: $_SESSION varibles not being removed...

Postby Oli Filth » Fri, 07 Oct 2005 05:23:46 GMT

Domestos said the following on 05/10/2005 20:52:


The browser retains the session cookie until it is closed.

The server retains the session details even though session_start() is 
not called on a particular script.


Re: $_SESSION varibles not being removed...

Postby Domestos » Fri, 07 Oct 2005 06:11:18 GMT

So how do I make sure all session details are removed when a user clicks 

Re: $_SESSION varibles not being removed...

Postby Stefan Rybacki » Fri, 07 Oct 2005 06:19:53 GMT

session_destroy is your friend.


Similar Threads:

1.i am going nuts = new session id just will not work


I have the following file:

if($s) {
 echo $s;
 echo 'your account has been loaded, <a 

I  run it like this: myfile.php?s=abc

It does not matter how many times I load it, whenever I load my test file:

echo session_id()

The same old session ID comes back (definitely not abc or any other 
parameter that I pass using s).  Having said that, in the link to index.php, 
it provides the new session ID, but as soon as I reload the page, we are 
back to normal.

The ONLY way to delete this old session ID is to delete the cookie from my 

What am I doing wrong.  It is driving me nuts!


- Nicolaas

2.Session varibles

I have a problem with session as:
if i write :
$_SESSION['id'] = 4;
$id = 7;
print $_SESSION['id']; // result:  4
varible of $_SESSION['id'] is 4, but i write :
$_SESSION['a'] = 4;
$a = 5;
echo '<a href="b.php">b.php</a>';
print $_SESSION['a']; // result: 5
i use Apache 2.2.8, PHP 5.2.6 ( embed in AppServ 2.5.10)
help me!

3.I am unable to start a session on my pages

4.Code ignighter - not using it - am I nuts?

Hi there,

I have a tight deadline to get a project finished. It's behind.

I'm plowing on using the old fashioned hand coding. But someone pointed out 
that I should use code igniter. I checked it out and it looks good, but I'm 
thinking the learning curve of learning it may not be worth the effort 
considering I have to get this done in 6 weeks.

What's others opinion of using frameworks like code-igniter?

Is it generally a no brainer to use such a tool? Are they widely used?


5.I am not able to see the executed output at all

 hi All,
I  am new to php and the using mozila firefox 3 , and IE 6 . But none
of them are able to show the output for the following p1.php file .

<title> PHP Test </title>
<?php phpinfo();  ?>

But the output of the program is the whole file as text?
What is going wrong here?

6. I am not able to use calendar options for PHProjekt 5.0.4

7. Mod_Perl vs PHP in memory, speed, varibles

8. session cart remove

Return to php


Who is online

Users browsing this forum: No registered users and 36 guest