Global function current_user() returning null while logged in

20 views
Skip to first unread message

Thom Mc

unread,
Feb 17, 2015, 9:50:34 PM2/17/15
to omek...@googlegroups.com
Hi,

I'm working on a plugin which extends the API.  It uses a custom controller which extends Omeka_Controller_AbstractActionController and implements getAction().

This is working ok and provides a usable API method, except that when I call current_user() or similar code to check a user is logged in, it returns null instead of the expected user object. 

Can anybody suggest why this might be?

Thanks,
Thom

John Flatness

unread,
Feb 18, 2015, 10:41:00 AM2/18/15
to omek...@googlegroups.com
Thom,

Since this is in the API, is your user "logged in" normally, or with a
key in the query string? The API doesn't respect cookie-based sessions,
only the given key (if any).

-John
> --
> You received this message because you are subscribed to the Google
> Groups "Omeka Dev" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to omeka-dev+...@googlegroups.com
> <mailto:omeka-dev+...@googlegroups.com>.
> To post to this group, send email to omek...@googlegroups.com
> <mailto:omek...@googlegroups.com>.
> Visit this group at http://groups.google.com/group/omeka-dev.
> For more options, visit https://groups.google.com/d/optout.

Thom Mc

unread,
Feb 18, 2015, 7:49:23 PM2/18/15
to omek...@googlegroups.com
Thanks John, that explains it.  Was looking for the cookie based login.
Reply all
Reply to author
Forward
0 new messages