Home arrow MySQL arrow Page 5 - Developing Custom PHP Sessions
MYSQL

Developing Custom PHP Sessions


Ever wondered how to make your own session handling functions with PHP? In this article Brian shows us how to do just that using PHP, MySQL and a bit of maths!

Author Info:
By: Brian Rosner
Rating: 3 stars3 stars3 stars3 stars3 stars / 41
July 21, 2002
TABLE OF CONTENTS:
  1. · Developing Custom PHP Sessions
  2. · Developing the Backend
  3. · Creating the Session Functions (contd.)
  4. · Using Our Sessions
  5. · Conclusion

print this article
SEARCH DEVARTICLES

Developing Custom PHP Sessions - Conclusion
(Page 5 of 5 )

You may have noticed that our sessions can be improved upon greatly. I've shown you one of the easiest ways of creating and maintaining your own sessions. If you are planning to improve the code seen in this article, then here are some ideas for expansion:
  • Instead of using a cookie to pass the key you can configure Apache to pass with folders. For example, www.domain.com/members/5i1hk6/welcome.php.
  • What if the user closed his/her browser before logging out? You may want to set up a cron job to run every five minutes to remove inactive sessions to keep the database clean.
  • You could also build an administration area to quickly configure your sessions and see who’s online and possibly kick them off whenever you desire.
You could have many more ideas to improve the sessions and I encourage you to try anything you wish now that you know how to build the sessions. Please do post in the forums to let us know about your ideas.
DISCLAIMER: The content provided in this article is not warranted or guaranteed by Developer Shed, Inc. The content provided is intended for entertainment and/or educational purposes in order to introduce to the reader key ideas, concepts, and/or product reviews. As such it is incumbent upon the reader to employ real-world tactics for security and implementation of best practices. We are not liable for any negative consequences that may result from implementing any information covered in our articles or tutorials. If this is a hardware review, it is not recommended to open and/or modify your hardware.

blog comments powered by Disqus
MYSQL ARTICLES

- MySQL and BLOBs
- Two Lessons in ASP and MySQL
- Lord Of The Strings Part 2
- Lord Of The Strings Part 1
- Importing Data into MySQL with Navicat
- Building a Sustainable Web Site
- Creating An Online Photo Album with PHP and ...
- Creating An Online Photo Album with PHP and ...
- PhpED 3.2 – More Features Than You Can Poke ...
- Creating An Online Photo Album with PHP and ...
- Creating An Online Photo Album with PHP and ...
- Security and Sessions in PHP
- Setup Your Personal Reminder System Using PHP
- Create a IP-Country Database Using PERL and ...
- Developing a Dynamic Document Search in PHP ...

Watch our Tech Videos 
Dev Articles Forums 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us 
Weekly Newsletter
 
Developer Updates  
Free Website Content 
Contact Us 
Site Map 
Privacy Policy 
Support 

Developer Shed Affiliates

 




© 2003-2017 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap
Popular Web Development Topics
All Web Development Tutorials