Dan06 Posted November 24, 2008 Share Posted November 24, 2008 I have a multi-part question: 1. Once the user has entered his/her user name and password, and those have been verified, is it better to use cookies or sessions? 2. What type of information for authentication monitoring should be stored in the cookie or session, i.e. id, password, etc.? 3. How would I go about creating the proper cookie/session via javascript to use in AJAX? - code examples, would be great. Thanks. Insight appreciated. Thanks. Quote Link to comment Share on other sites More sharing options...
Dan06 Posted December 1, 2008 Author Share Posted December 1, 2008 I decided to use sessions. Once the user name and password are verified, I chose to create two session variables: user name and session id. Anytime an event occurs, i.e. clicking a button, refresh, etc. I set my javascript code to call a php function to verify if the two session variables are set. If they are set then the process can continue otherwise, the process ends and returns to the login page. Is this the best way to go or is there a better way? Thoughts, suggestions appreciated. Thanks. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.