|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
||||
|
||||
|
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... |
|
#2
|
|||
|
|||
|
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....
|
|
#3
|
||||
|
||||
|
RE: unset
Nice try, but it didn't work. It is one frame in page that uses several if that makes any difference.
|
|
#4
|
|||
|
|||
|
RE: unset
"It is one frame in page that uses several if that makes any difference."
I don't understand that? |
|
#5
|
||||
|
||||
|
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...
|
|
#6
|
||||
|
||||
|
RE: unset
Have you try to use session_destroy() ? is it work ?
|
|
#7
|
||||
|
||||
|
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. |
|
#8
|
|||
|
|||
|
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 ;) |
|
#9
|
||||
|
||||
|
RE: unset
I appreciate the thoughts zombie but the logoff was a method that looked like :
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. |
|
#10
|
|||
|
|||
|
RE: unset
it worked for me (apache 1.3 + php 4.1.0 and 4.2.3)
|
|
#11
|
||||
|
||||
|
RE: unset
I'm luckkkkyy...i'm luckkkyyyy.
|
![]() |
| Viewing: Codewalkers Forums > PHP Related > PHP Coding > unset |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|