[Fixed]-Session variable becomes null on refreshing the template

1👍

I’m not exactly sure what you are doing here, but it sounds like you just need to check that city is actually supplied before setting it.

city = request.GET.get('city')
if city:
    request.session['city'] = city

Leave a comment