I solved my problem, and it could definitely help others too.
The problem was with cookies since my folder structure was like this :
the cookies were only valid for wordpress folder, and it’s subdirectories.
In order to activate the cookies outside wordpress, I installed the root Cookie plugin, and everything works fine now.
Do NOT change the configuration of root Cookie. Just leave the Domain Name setting as empty.