I need a url for using that for a template. Now there are two ways of storing the url and use that again in python I guess...
One is using session to store that URL and get it later whenever we need it...
or 
Second is using cookies to store that URL and get it later..
So which method is more appropriate in terms of security ?
Is there any other method in python which is more better for storing the url and use that later, which is more secure..?
While using cookies somebody can easily change the information I guess, in sessions also somebody can hijack it and make the changes....
In terms of security, you should store it in session. If it's in cookie, the client can modify your url to whatever he wants.
Storing URL into cookies or session?