Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6779741
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T16:25:25+00:00 2026-05-26T16:25:25+00:00

Okay, so hopefully I am asking this question correctly: I set up my user

  • 0

Okay, so hopefully I am asking this question correctly:

I set up my user model & controller, as well as my session model and controller… but I want to render some of the session info onto a page.

for example
If I were to login to a page, it would read “Brian” (or whatever my username is that I used for my login)

I hope I am not asking a repeated question — I have searched this question pretty extensively and haven’t found a solution yet. Thanks a lot!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T16:25:26+00:00Added an answer on May 26, 2026 at 4:25 pm

    If your session (set in a config/bootstrap file) is called “default” then just run check …

    $user = Auth::check('default');
    

    Then $user will have an array of the user data in the session, so if you have a first_name field in your database/session you could do:

    echo $user["first_name"];
    

    I created a helper to clean this up a little, I called it: extensions/helper/Login.php

    <?php
    
    namespace app\extensions\helper;
    use lithium\security\Auth;
    
    class Login extends \lithium\template\Helper {
    
        public function user() {
    
            $user = Auth::check('default');
    
            return $user;
        }
    
        public function fullName() {
    
            $user = self::user();
    
            return $user["first_name"] . " " . $user["last_name"];
        }
    
    }
    
    ?>
    

    Then in my Views I used it like …

    <?=$this->login->fullName(); ?>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Okay, the question might seem dumb, but I'm asking it anyways. After struggling for
Okay, here goes. Stack Overflow virgin here but hopefully you guys will be able
Okay, so this seems simple, but I can't think of a straightforward solution; Basically
Okay, I feel like I should be able to do this, but I have
Okay so this is sort of a double question so I'll split it into
Okay, so this is a long long shot but here it goes... When IE
Okay so my question is this. Say I have a simple C++ code: #include
Okay, so the answer to my question might not be the problem but here's
Okay guys hopefully I can explain this effectively, so here goes. I have a
Okay so im working on this php image upload system but for some reason

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.