Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to update authorisation in cache with PHP?

Status
Not open for further replies.

TerryJones

Programmer
Jul 19, 2000
15
AU
Dear all,<br><br>I have a script where the user has to authorise themselves (eg: Username=fred Password=hi). When they are authorised, they gain access to their details.<br><br>HOWEVER, the user is allowed to update their password (eg: password changed to &quot;bye&quot;)!<br><br>This is a problem, as the user then returns to their details, & when reload informed that they are not authorised (password in cache isn't updated!) ... thus they must close the browser & relogin (a very bad thing!).<br><br>If anyone can inform me of how to update the Authorisation details ... please inform.<br><br>ALSO, if anyone knows how to remove username & password from cache, please inform (as it would allow user to logout ... without closing browser!).<br><br>Please note, for the first instance, I need to be able to update the cache of the clients browser, removing it from cache (which I can't even do), would cause my boss's clients to be very unhappy, as they would have to type in their details again, each time they went to a new page on the site I'm building ... and its 15 pages so far!<br><br>Thank you all.
 
I'm not too sure of what you're doing, so I'm assuming you need the user's name and password to be tracked around the site. If so, you're using some session handling.

In that case, just make sure that not only are you updating the password in the database, you're updating the password session variable.

If this is not the case, just give more detail of how your login system works, and I might be able to help.

Logging out takes nothing more than than this line of code:

[tt]session_destroy();[/tt]

Of course, that is only if you're using sessions.
 
If you are using sessions, just reissue the session_register command passing the name of the variable containing the new password. Note, however, that if the session variable and the POST variable have the same name then you will need to do something like:

$password = $HTTP_POST_VARS[&quot;password&quot;];
session_register(&quot;password&quot;);

for it to work
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top