18.11.2013, 13:12
So over the past few days, I've been thinking of some unique ideas to effectively share data across other scripts, when I came across this idea: sessions
Basically, in PHP, you can do this:
And I'm developing a PAWN library that allows scripters to do this:
And with this library, scripters can share this data across all scripts using the session_get functions.
But the real million dollar question: is it worth it? It uses a single SQLite database to temporarily save and fetch values until the session is destroyed, but I want to know if using a SQLite database is the best choice or if there are any other alternatives.
What do you think about this idea?
Basically, in PHP, you can do this:
PHP Code:
<?php
session_start();
$_SESSION['texta'] = 'dog';
$_SESSION['textb'] = 'cat';
$_SESSION['textc'] = 'fox';
echo $_SESSION['texta']."<br/>";
echo $_SESSION['textb']."<br/>";
echo $_SESSION['textc']."<br/>";
session_destroy();
?>
pawn Code:
main()
{
session_start();
session_set("texta", "dog");
session_set("textb", "cat");
session_set("textc", "fox");
print(session_string("texta"));
print(session_string("textb"));
print(session_string("textc"));
session_destroy();
}
But the real million dollar question: is it worth it? It uses a single SQLite database to temporarily save and fetch values until the session is destroyed, but I want to know if using a SQLite database is the best choice or if there are any other alternatives.
What do you think about this idea?