View Full Version : Login problem in php

03-15-2009, 10:09 PM
Hey, in my site user can login from any page as login control is available in every page. but the problem is when user login, after checking validation the user is redirected a certain page(like user profile page).

so user losses track of current page. i want to control the website such that when user login from which page he/she login he will remain in the same page. i have a solution, but i think there is a better solution.

please help me out as early as possible
thanks in advanceeeeeee

03-15-2009, 10:32 PM
best way to check for user information is to store it in server $_SESSIONS, and local $_COOKIES.

every good browser has options to store cookies on user computer. when user visits your website you can check weather his browser has some cookies stored about it. if it does you can then use them to load content based upon what those cookies say

$_SESSIONS are similar to cookies, except they are stored on server as on local computer.