# Reading PHP-Session from CakePHP

**URL:** <https://discourse.cakephp.org/t/reading-php-session-from-cakephp/3470>\
**Category:** Need Help\
**Created:** [November 9, 2017, 12:57pm UTC](https://discourse.cakephp.org/t/reading-php-session-from-cakephp/3470 "2017-11-09T12:57:48Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![abraxus](https://avatars.discourse-cdn.com/v4/letter/a/91b2a8/32.png) [@abraxus](https://discourse.cakephp.org/u/abraxus)\
**Post date:** [November 9, 2017, 12:57pm UTC](https://discourse.cakephp.org/t/reading-php-session-from-cakephp/3470/1 "2017-11-09T12:57:48Z")

</div>

Hello,

I have a Session that remembers several logins on my website. There are more than 2 scripts, that need a login. So they are bundled with one Login-System now.

Unfortunately I really need CakePHP to call an existing PHP-Session, e.g. $\_SESSION[‘lang’].

echo $\_SESSION[‘lang’] inside a .ctp-file provideds an empty output.

Intended workflow:

> If lang==fr  
> include (fr.ctp)  
> if lang==en  
> include (en.ctp)

If anyone could tell me how to solve the problem or how to create a workaround, that would be great!

---

<div class="post-metadata">

**Author:** ![rrd](https://yyz1.discourse-cdn.com/flex029/user_avatar/discourse.cakephp.org/rrd/32/113_2.png) [@rrd](https://discourse.cakephp.org/u/rrd)\
**Post date:** [November 9, 2017, 4:25pm UTC](https://discourse.cakephp.org/t/reading-php-session-from-cakephp/3470/2 "2017-11-09T16:25:22Z")

</div>

Did you tried `$this->request->session()->read('lang')` ?
