Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

We've moved the forum!

Please use forum.silverstripe.org for any new questions (announcement).
The forum archive will stick around, but will be read only.

You can also use our Slack channel or StackOverflow to ask for help.
Check out our community overview for more options to contribute.

General Questions /

General questions about getting started with SilverStripe that don't fit in any of the categories above.

Moderators: martimiz, Sean, Ed, biapar, Willr, Ingo, swaiba

about Silverstripe session


Go to End


3 Posts   2250 Views

Avatar
bebabeba

Community Member, 193 Posts

12 October 2011 at 9:41pm

Hi!
I read about session and I have a lot of doubt about it.
Silverstripe set session in main.php with Session::start().
When Silverstrupe write or update session? Is possible save data in session in every part of my site? For exampe in Page.php or not (this question is connect with time to long for writing ad reading data in session)?
If I set a session varaible for example $_SESSION['test']=$xml->saveXML(); can I repeat this action more then one time in my Page.php function? Or si there an exact point in witch is better to execute and only one time?

Thanks..

Avatar
bebabeba

Community Member, 193 Posts

14 October 2011 at 7:37pm

any idea???

Avatar
martimiz

Forum Moderator, 1391 Posts

15 October 2011 at 6:18am

you can use the SilverStripe Session object and do Session::set('name', 'jack'); or Session::get('name');

multiple session vars isn't a problem, and you can set them from anywhere, but I guess there's always the chance a session times out if a user stays too long on a page...