Hallo,
wenn Du ein Plugin entwickelst, hast Du keinen Einfluss auf die "wp-config" der jeweiligen Wordpress installation, wo Du Sessions aktivieren kannst. also musst Du einen kleinen Workaround machen und per hooks arbeiten:
add_action('init', 'myStartSession', 1);
Wichtig ist die '1'. Das steuert die Prioritaet wann dieser hook lauft. in diesem Fall VOR allen anderen.
Und natuerlich musst Du die Session dann auch bei Bedarf wieder beenden:
add_action('wp_logout', 'myEndSession'); add_action('wp_login', 'myEndSession'); function myStartSession() { if(!session_id()) { session_start(); } } function myEndSession() { session_destroy (); }
Jetzt kannst Du mit der Session arbeiten:
$_SESSION['firstKey'] = "Was ich spaeter brauche"; Und so bekommst Du spaeter Deinen Wert wieder:
if(isset($_SESSION['firstKey'])) { $value = $_SESSION['firstKey']; } else { $value = ''; }
Ich hoffe das hilft Dir weiter.
Gruesse,
Joe