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.

Accessing session data

August 31, 2010 7:06am

Subscribe [3]
  • #1 / Aug 31, 2010 7:06am

    Ace Prod

    111 posts

    Hi,

    Trying to figure out how to access sessions for a guest user.

    I want to be able to save the session id and cart contents to a temporary table.

    All I need to be able to do is get the session id of the user.

    I have tried to use $this->EE->session->userdata[‘session_id’] but it is not returning a value. What do I need to do to be able to access this?

    Cheers!

  • #2 / Aug 31, 2010 4:19pm

    Ingmar

    29245 posts

    Does it work for logged-in users? To be honest I don’t think EE creates a user session for anonymous users.

  • #3 / Sep 03, 2010 5:07am

    Ace Prod

    111 posts

    I got it to work using

    global $SESS
    $SESS->session_id

  • #4 / Sep 03, 2010 7:53am

    Sue Crocker

    26054 posts

    Glad you were able to figure out what the problem was. Don’t hesitate to post again as needed.

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

ExpressionEngine News!

#eecms, #events, #releases