php - Associating a Function to Fire on session_start()? -


I searched the web but could not solve the following challenge:

I Also want to execute a function like when the session_start is called independent from page session_start , then it is implemented. The function I have to restore to constants is stored in get_defined_constants () by using $ _ session = so that they are again available on any PHP page.

This seems very simple to me, but I'm pretty sure that the PHP session extension does not support the registration of events defined by the user. I was thinking that if anyone has insight on this issue, then I can either find out the solution or am trying.

Ideally, I just want to register the ceremony on run-time like this:

$ constants = get_defined_constants (); $ _SESSION ["constant"] = $ constant ["user"]; Function event_handler () {foreach ($ _SESSION ["constants"] as $ key = & gt; $ value) {define ($ key, $ value); }} Register_handler ("session_start", "event_handler");

In any webpage, I could simply go:

  session_start ();  

And all my stability will be available again.

Any help would be greatly appreciated.

What you are looking for is that although the functionality is not as much as you want, it fits in the bill. it happens.


Comments

Popular posts from this blog

windows - Heroku throws SQLITE3 Read only exception -

lex - Building a lexical Analyzer in Java -

python - rename keys in a dictionary -