0

Is there a way to create a list of nodes that the anonymous user has created and limit it only by the user's current session?

Basically I want the anonymous user to create a node under a specific content type and give that user a list of nodes (maybe using views) that he or she created only during the his or her current session on the site.

Anybody willing to help? I've been trying this the whole day and can't seem to get it done.

0

You should be able to use hook_node_insert to grab the nid of the node that is being created. Take the nid and add it to $_SESSION. Then create a View that accepts NIDs as contextual arguments. You'll need to do some additional coding to grab those NIDs from the session and pass it to the View.

  • but how does it prevent access from others? – AyeshK Mar 13 '15 at 13:05
  • Thank you for your answer. Sorry but I'm not that code savvy, I'm not used to using hooks and the sort. Is there a way to make this easier? – Joshua Abellare Mar 15 '15 at 9:01
  • Maybe there is a way to limit views based on the user's current session? – Joshua Abellare Mar 15 '15 at 10:31
  • @AyeshK... what are you trying to prevent access to? This solution simply stores the list of nodes an anonymous user created so we can easily display that list of nodes. – Craig Mar 16 '15 at 12:23
  • @JoshuaAbellare... I'm not aware of any existing modules that do what you're looking for. This would require a small amount of coding to accomplish. – Craig Mar 16 '15 at 12:24

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.