PHP Coding
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Codewalkers ForumsPHP RelatedPHP Coding

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Codewalkers Forums Sponsor:
  #1  
Old November 6th, 2002, 09:57 AM
postmoderngoblin's Avatar
postmoderngoblin postmoderngoblin is offline
Contributing User
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Location: UK
Posts: 55 postmoderngoblin User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 17 m 53 sec
Reputation Power: 2
unset

has anyone else had trouble using unset?

Heres my situation, I've got a whole load of scripts working with each other but the essential information is as follows:

Logging in to my page is triggered by a user going to the url, this evebtually checks to see if the user is authorised to view the site, if not the log on screen is loaded.

The checks to find out if a person can log on check $_SESSION variables.

at log off I use unset to destroy these variables. Once this has been done I can in fact see that $_SESSION is an empty array.

I then use a html meta refresh tag to send the user back to the url that will check authorisation.

When the page refreshes the session variable are somehow restored and the user is returned to the default screen that appears after logging in with all their former privileges.

Any ideas guys/gals? My first suspicion is that the meta refresh works differently to how I would think.

Please help - this one has been winding me up for days...

Reply With Quote
  #2  
Old November 6th, 2002, 11:39 AM
Anonymous Anonymous is offline
Registered User
Codewalkers God 35th Plane (22000 - 22499 posts)
 
Join Date: Apr 2007
Posts: 22,309 Anonymous User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 24
RE: unset

Well, a meta refresh simply tells the browser to refresh. The contents of the web page could be stored in the browsers cache, and therefore making it seem like the session variables are still set...youcan try and get around this by placing no cache tags at the top of the page....

Reply With Quote
  #3  
Old November 6th, 2002, 12:18 PM
postmoderngoblin's Avatar
postmoderngoblin postmoderngoblin is offline
Contributing User
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Location: UK
Posts: 55 postmoderngoblin User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 17 m 53 sec
Reputation Power: 2
RE: unset

Nice try, but it didn't work. It is one frame in page that uses several if that makes any difference.

Reply With Quote
  #4  
Old November 6th, 2002, 02:12 PM
Anonymous Anonymous is offline
Registered User
Codewalkers God 35th Plane (22000 - 22499 posts)
 
Join Date: Apr 2007
Posts: 22,309 Anonymous User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 24
RE: unset

"It is one frame in page that uses several if that makes any difference."

I don't understand that?

Reply With Quote
  #5  
Old November 6th, 2002, 02:33 PM
postmoderngoblin's Avatar
postmoderngoblin postmoderngoblin is offline
Contributing User
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Location: UK
Posts: 55 postmoderngoblin User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 17 m 53 sec
Reputation Power: 2
RE: unset

just letting people know that I am using frames on the chance that might affect suggestions, I just put it badly. Its a bi-product of living in milton keynes, my brain is turning into a puddle of goo...

Reply With Quote
  #6  
Old November 6th, 2002, 02:59 PM
hermawan's Avatar
hermawan hermawan is offline
Superman is not dead
Codewalkers Novice (500 - 999 posts)
 
Join Date: Apr 2007
Location: Jakarta, Indonesia
Posts: 552 hermawan User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 14 h 21 m 55 sec
Reputation Power: 2
Send a message via ICQ to hermawan Send a message via AIM to hermawan Send a message via Yahoo to hermawan Send a message via Google Talk to hermawan Send a message via Skype to hermawan
RE: unset

Have you try to use session_destroy() ? is it work ?

Reply With Quote
  #7  
Old November 6th, 2002, 03:15 PM
postmoderngoblin's Avatar
postmoderngoblin postmoderngoblin is offline
Contributing User
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Location: UK
Posts: 55 postmoderngoblin User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 17 m 53 sec
Reputation Power: 2
RE: unset

Darn do I wish I could shake your hand. Thank you, it now works. If you were here I might have kissed you - which is so far out of character for me its silly, so count yourself lucky.
Cheers.

Reply With Quote
  #8  
Old November 7th, 2002, 12:18 AM
zombie zombie is offline
Codewalkers Intermediate (1500 - 1999 posts)
 
Join Date: Apr 2007
Location: serbia
Posts: 1,876 zombie User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 3
RE: unset

unset() should work, but not the way i thing you used it.

as it says in the manual, u can use unset($_SESSION['varname']) to destroy, or "un-register" that variable.

i think that u where using unset on the whole $_SESSION like unset($_SESSION) and the man doesn't say anything on what that does ;)

Reply With Quote
  #9  
Old November 7th, 2002, 08:19 AM
postmoderngoblin's Avatar
postmoderngoblin postmoderngoblin is offline
Contributing User
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Location: UK
Posts: 55 postmoderngoblin User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 17 m 53 sec
Reputation Power: 2
RE: unset

I appreciate the thoughts zombie but the logoff was a method that looked like :

php Code:
Original - php Code
  1.  
  2.   function fw_user_logoff( ) {
  3.     unset( $_SESSION['fw_user'] );
  4.     unset( $_SESSION['fw_language'] );
  5.     unset( $_SESSION['fw_roles'] );
  6.     unset( $_SESSION['fw_portlet_menu'] );
  7.     unset( $_SESSION['fw_portlet_informer_info'] );
  8.   }


and that was indeed all of the session variables, like I said you could run this method and then echo out session - I've got some methods for doing that sort of thing nicely aswell, and it was an empty array, until refreshing the page. In the end I used this method followed by the php methods session_unset, and session_destroy. And now it stays dead.

Raa.

Reply With Quote
  #10  
Old November 9th, 2002, 03:11 AM
zombie zombie is offline
Codewalkers Intermediate (1500 - 1999 posts)
 
Join Date: Apr 2007
Location: serbia
Posts: 1,876 zombie User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 3
RE: unset

it worked for me (apache 1.3 + php 4.1.0 and 4.2.3)

Reply With Quote
  #11  
Old November 11th, 2002, 10:07 AM
hermawan's Avatar
hermawan hermawan is offline
Superman is not dead
Codewalkers Novice (500 - 999 posts)
 
Join Date: Apr 2007
Location: Jakarta, Indonesia
Posts: 552 hermawan User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 14 h 21 m 55 sec
Reputation Power: 2
Send a message via ICQ to hermawan Send a message via AIM to hermawan Send a message via Yahoo to hermawan Send a message via Google Talk to hermawan Send a message via Skype to hermawan
RE: unset

I'm luckkkkyy...i'm luckkkyyyy. Sorry, just want to make my number of post bigger.

Reply With Quote
Reply

Viewing: Codewalkers ForumsPHP RelatedPHP Coding > unset


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 5 hosted by Hostway