Check session and cookie not working in PHP -
I have this code which ensures that you are logged in, and then make sure that you check the cookie and the right page Setting Up on Login This code works on any page in a directory below the login in the script, though there is a thought in a page in the directory given below which takes you to Accessidid?
& lt ;? Php session_start (); If (! Isset ($ _ session ['SESS_MEMBER_ID']) ((Trim ($ _ session ['SESS_MEMBER_ID']) == '')) {header ("Location: http://mywebsite.com/member/accessdenied HTML "); Exit ();} $ _COOKIE [" Verify "] = $ Verify; if ($ Verify! = File_get_contents (" name.txt ")) {Header (" Location: http: // mywebsite .com / member / accessdenied.html ");} and {}? & Gt;
And it just looks like lower part, the part that checks the cookie, works Again, any thoughts?
I think your cookie work The phrase is behind:
$ _COOKIE ["verify"] = $ verify;
should be
$ Verify = $ _COOKIE ["Verify"]
and it should be:
$ verify = isset ($ _COOKIE ["Verify "]" $ _COOKIE ["Verify"]: Wrong;
As the cookie was not set previously, this notice will be a mistake.
Comments
Post a Comment