Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Typo3 Extbase Set and Get values from Session

I am writing an extbase extension on typo3 v6.1 That extension suppose to do a bus ticket booking. Here what my plan is, user will select date and number of seats and submit the form.

Here my plan to push the date and rate of the selected seat to session (Basket). And while making payment, I wanted to get that values from session and after payment I need to clear that particular session.

So In short, How to Push and retrieve the values to and from the session in extbase. Any suggestions ? Thank you.

like image 532
Ganybhat-Satvam Software Avatar asked Dec 01 '22 20:12

Ganybhat-Satvam Software


1 Answers

There are different ways. The simplest would be for writing in the session

$GLOBALS['TSFE']->fe_user->setKey("ses","key",$value)

and for reading values from the session

$GLOBALS["TSFE"]->fe_user->getKey("ses","key")
like image 101
freshp Avatar answered Dec 05 '22 00:12

freshp