I disagree with Cici I understand them perfectly. However, "for as long as" and "as long as" have the same meaning. However, your confusion here is the use of the world "for". When should you use it and when you shouldn´t use it? Unfortunately prepositions in every language are hard and there are sometimes no rules. For example:
We say "in school" but not "in home".
Using the Phrase "as long as" or "for as long as" will require seeing a lot of examples.
Sometimes they are interchangeable like the sentences you gave.
Sometimes only one can work.
She had loved me for as long as I can remember
She had loved me as long as I can remember. (Without using "for" his just sounds wrong.)
This answer is as long as can be.
This answer is for as long as can be. (Using "for" just sounds wrong here.)