IMPLEMENTING SESSIONS WITHIN COPPERMINE IMPLEMENTING SESSIONS WITHIN COPPERMINE
 

News:

cpg1.5.48 Security release - upgrade mandatory!
The Coppermine development team is releasing a security update for Coppermine in order to counter a recently discovered vulnerability. It is important that all users who run version cpg1.5.46 or older update to this latest version as soon as possible.
[more]

Main Menu

IMPLEMENTING SESSIONS WITHIN COPPERMINE

Started by laurent, January 02, 2004, 07:28:12 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

laurent

Hi all,

first I wish you all all the best for this new year.

Ok, so let start now.
I discovered coppermine few weeks ago and had a deep look to the code. I was very please to see that clean codes still exist! I noticed that few variables such as config parameters, account parameters and few others are initiated by the "init.inc.php". This include is included in most of pages so the parameters are available.

The "init.inc.php" call at least 6 database queries. It means that each time a page is loaded, those 6 queries are performed. It obviously means that you have at least 6 queries in all pages. Why didn't you use the sessions instead? Is it for historical reasons (sessions weren't implemented  within PHP when coppermine was first released) or other?

I mean by that if we use sessions variables to store config and account parameters, it could be done only once per session. Let say a visitor who is visiting 50 pages (index, album index and 48 pictures) you would save 300 queries.

Do you plan to implement sessions in the future? I would be glad to do it as part of the devellopers team. Let me know if you are interested.

Kind Regards,

Laurent Sicard

Joachim Müller

Laurent,

thanks for the offer, every helping hand is appreciated. As coppermine.sf.net is a quite young project we haven't made up our minds yet on dev team membership policy, so I suggest you just do a cvs devel branch checkout and have a look at what's there yet.

Thumbsup :D

GauGau

hyperion

This woud certainly help speed up Coppermine and prevent DB overuse problems for larger implementations.
"Then, Fletch," that bright creature said to him, and the voice was very kind, "let's begin with level flight . . . ."

-Richard Bach, Jonathan Livingston Seagull

(https://coppermine-gallery.com/forum/proxy.php?request=http%3A%2F%2Fwww.mozilla.org%2Fproducts%2Ffirefox%2Fbuttons%2Fgetfirefox_small.png&hash=9f6d645801cbc882a52f0ee76cfeda02625fc537)

Tarique Sani

Hmm... Well sessions might speed up things OR might not - lets see some code and real life bench marks
SANIsoft PHP applications for E Biz

hyperion

True, Tarique.  I know you have an aversion to sessions.  :D
"Then, Fletch," that bright creature said to him, and the voice was very kind, "let's begin with level flight . . . ."

-Richard Bach, Jonathan Livingston Seagull

(https://coppermine-gallery.com/forum/proxy.php?request=http%3A%2F%2Fwww.mozilla.org%2Fproducts%2Ffirefox%2Fbuttons%2Fgetfirefox_small.png&hash=9f6d645801cbc882a52f0ee76cfeda02625fc537)

Tarique Sani

Quote from: "hyperion"True, Tarique.  I know you have an aversion to sessions.  :D
No I don't have aversion to sessions - in fact as one of the core devs of PHPlib I have been using sessions since the time they were not available in PHP :D
SANIsoft PHP applications for E Biz

hyperion

My mistake then.  :lol:  

Perhaps I should say you have a cautious approach to sessions?  :D
"Then, Fletch," that bright creature said to him, and the voice was very kind, "let's begin with level flight . . . ."

-Richard Bach, Jonathan Livingston Seagull

(https://coppermine-gallery.com/forum/proxy.php?request=http%3A%2F%2Fwww.mozilla.org%2Fproducts%2Ffirefox%2Fbuttons%2Fgetfirefox_small.png&hash=9f6d645801cbc882a52f0ee76cfeda02625fc537)

Joachim Müller

[list=1]...especially since there might be two issues on sessions:
  • backward compatibility
  • user confusion and support questions[/list:o]I agree with Tarique: let's see the code and decide then if it will go into the coppermine core or will be an add-on.

    @laurent: don't get discouraged by this discussion, it's sort of dev-talk - no need to be nice just for the sake of it; if a decision needs to be made on the general way coppermine is going to take, it's not a matter of personal preferences, but global arcitecture as well as common sense... Please go ahead and code your session mod!

    GauGau

Tarique Sani

@laurent : just to repeat Gaugau - don't get put off by my (or any other devs) comments, Just that we have to keep the 1000's of users in mind whenever we change any thing in core.

Also how about looking into a better Auth scheme with sessions (since you are going to put in sessions anyways :)
SANIsoft PHP applications for E Biz

laurent

Hi guys.

No don't worry I won't get discourage by such a discussion. When I got some ideas in mind.....I never give Up. The fact is that my first post was to let you know that I think that the use of sessions woul be a great improvement in Coppermine security and performance. I am currently analyzing what would be involved in such that devellopment.

Gaugau has the point: would it be a core change or just an add-on (module). My decision would be to go with some core changes in the code since coding it as a module would have the result I try to avoid (more control loop and more queries and more.....)

I can ensure tarique that yes, performances will be improved (database less solicited) I have no doubt on that, I will give you the bench.

I'm on it but it could take a while since I have many others dev on the hand and a Job.

I'm glad to see that this feature interests some people who are consciensious that it could be a great improvement...for now and the future.

I apologize for my unperfect english since I'm a French guy...in Montreal.

   Laurent

epsilon

My site have 10.000 unique visitors per day and 28.000 impressions, and my cpu and ram is at 99% by te sql requests, sometime i get the error (too many connections to mysql) i think that this is the solution of my problem, i wanna be your beta tester, please contact with my laurent, you have my messenger (epsilonz@msn.com) add me, i wanna talk with you. Please do it...

laurent

Ok I added you in my contact list. SO now I'm waiting for you to be online.
Could you give me the website address.

Whoever is interested to help is welcome. I'm currently analyzing the whole code, and want to make global improvements in one aim:
IMPROVE PERFORMANCES, AND TO AVOID UNNECESSARY SQL REQUEST OR CRAZY CONTROL LOOPS (and believe me there are a lot of them)

Kind Regards,

Laurent SIcard