It resembles an Aloe or Agave maybe a Pandanus, I am not sure. The leaves are spiky. The flower seems to be on its way out, but more or less it looked the same before I took the pictures. Long stalk, with red bloom.
The plant is not mine, I took the pictures in the stairway of a flat. They kept the plant on the window sill all winter, an unheated area.