I am trying to use session to pass some data from one page to another page. Here is the code i wrote in ajax.py.
def save_cookie(request, query):
request.session[ query ] = query
But when i call this dajaxice function.An error will occurred. As we all know that when we try to use dajaxice in html page, the error msg always is "sth goes wrong". I tried to debug save_cookie, but the mock request object i created has no session attr. However, if i do request.session="blah", it worked. If I directly use save_cookie(request,query). It will pop up the error msg that request object has no attr seesion...
代码是直截了当的,我没有看到任何错误,有人知道原因吗?