Concept of the generation of a signed cookie

I'd like to know how to generate a signed cookie based on a user's login data.

The following is what I can think of according to the knowledge I have:

enter image description here

  1. The user enters his account and password on the client side.
  2. The server receives the account and password, then encrypt these data using a key. The result of the encryption will be stored in the server for a period of time.
  3. The encryption result (which equals the signed cookie) is returned back to the client.

The server can use this cookie to identify the client if the cookie isn't expired.

Did I miss anything in the process of the generation of the signed cookie? Or is there anything wrong with the process?