It has two uses. One would be like in this sentence, just like any word – to mean 'a kind of, a sort, a type', literally.
The other use is as a filler word, much like English like. 'He was, like, about the same age as me'
We use the latter one a lot and it's getting less and less slangy and more and more just normal colloquial language.
Thank you, zmrzlina. As for jarretph, you are right of course. But notice that in the Swedish, it is 'sorts' that is modified into the genitive, not 'cookie'. But in the English, 'kind' is not similarly modified. Instead, 'cookie' gets modified to 'of cookie', which is rather like a genitive. So that was the reason for my question. (Compare 'the book of my father' and 'my father's book'. Similarly, compare 'a sort of cookie' to 'a cookie of sorts/a sort'.)