session

How to implement user authentication in a Play Framework application

Table of Contents1 - Resources2 - A custom user authentication action3 - Use that action in your controller methods4 - A sample form5 - Setting the user login cookie6 - Discussion

This past week I started working with the Play Framework (version 2.6), and this is a quick look at how to implement user authentication in a Play application. Specifically this blog post focuses on how to create a custom action so you can secure your Play controllers methods, where you’ll implement those methods using this new, custom action.

Play Framework session cookie name

The Play Framework session cookie name is PLAY_SESSION. You can find this in the Play docs here.

Here’s a quote from that page:

A CakePHP jQuery fade out flash success message

CakePHP flash fade out success messages: If you'd like to show fade out success messages in your CakePHP applications using jQuery, like the ones currently used by applications such as Twitter and Facebook, I thought I'd share the formula I came up with this weekend. While it includes touching a few different files, it's pretty easy, and once you've done the basic setup work you can display CakePHP fade out success messages in all of your web pages, and web applications.

CakePHP Auth login - User login information

CakePHP Auth user login FAQ: Help, how do I get access to the CakePHP user object (user information) after using the CakePHP Auth component for the recommended CakePHP user login process?

Java servlet session - how to test for a valid session in a servlet

When you're writing Java web applications -- for example, an application like a discussion forum -- you end up writing Java servlets where you need to know if the user accessing your servlet has a valid Java servlet session established. If they have a valid servlet session established, you might do one thing in your servlet code, but if they don't have a valid servlet session, you might handle their request differently.

How to put an object on the request in a servlet

Many times when you're working with Java servlets and JSP's, you'll want to forward some piece of information from your servlet to your JSP without having to put that piece of information into the session. For instance, in many applications you may not have a user session, and in other cases where you do have a session, you may just not want to put a bunch of junk in there.

How to test for a valid user session in a JSP alvin June 1, 2009 - 8:54am

Note: This approach is very old; Java/JSP scriptlets were deprecated a long time ago. I don't have time to update this article to the correct, modern approach, but I hope this JSP session example will point you in the right direction.

Every once in a while I'm asked something like, "How can I tell if I have a valid user session in my JSP code?"