ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

How to read the user cookie set by EE?

January 14, 2012 12:48pm

Subscribe [1]
  • #1 / Jan 14, 2012 12:48pm

    olympiaverlag

    1 posts

    How can i get access to the cookies set by EE?

    We are running a second application on the same domain and want to check by cookie if the user is logged - and if so - which username he has?

    The login is done by EE -> cookie only (not session based).

    How can the second application get information about the user?

    EE-Cookies - User is not logged in:
    - xx_last_activity
    - xx_last_visit
    - xx_tracker

    EE-Cookies - User is logged in:
    - xx_last_activity
    - xx_last_visit
    - xx_tracker

    - xx_sessionid
    - xx_experation
    - xx_anon

    The user information may be saved in the last three cookies.
    But how can read or encrypt the info in the cookie out of EE??

    Thanks in advance…

  • #2 / Jan 16, 2012 2:16am

    John Henry Donovan

    12339 posts

    Hi olympiaverlag,

    You won’t be able to get a username from the cookies set by EE.
    I would suggest creating your own cookie in EE after login that contains a member ID then in your other application use the member ID to query the EE database to pull whatever you need.

    Is your other application built on CI?
    EE can pull member information using the Session Class

  • #3 / Jan 16, 2012 4:02am

    olympiaverlag

    1 posts

    Hi John,

    thanks for your reply… ok we will try to setup our own cookie, but how can i jump in the login- and logout-action to set and delete the cookie to the right time -> synchronous when the user clicks login/logout?

  • #4 / Jan 18, 2012 5:27am

    John Henry Donovan

    12339 posts

    Hi olympiaverlag,

    There is an SSO add-on for Vanilla forums and EE which might be a good one to dissect and see how they did it. If you wish I can move this thread to the Community Help forums for you?

.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases