MySQL Forums
Forum List  »  Stored Procedures

MySQL 5: Web Session Management with Stored Procs
Posted by: James Bromberger
Date: April 06, 2005 08:29AM

So, here is an implementation of a web session (cookie based) system using stored procedures:

http://www.james.rcpt.to/programs/mysql/5websessions/

I was planning on using triggers on the session table to generate updates to the user table (last login time, last access time), however it seems you cant launch a trigger from within a stored procedure. Perhaps. At least, when I tired it, MySQL told me the table was locked for READ, so now the login() and cookie_session() procedures I have written to these updates tot he user table themseleves.

I am sure this is the start of many implementations like this. Yay for stored procs! I was thinking of modifying the cookie_session() proc so that it randomly called the clean_sessions() proc (say, 1% of the time that cookie_session() is called).

Feedback and suggestions welcomed.

James Bromberger, http://www.james.rcpt.to

Options: ReplyQuote


Subject
Views
Written By
Posted
MySQL 5: Web Session Management with Stored Procs
3917
April 06, 2005 08:29AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.