and it were possible would be considered a vulnerbility.

You can do

image1.element(_type='submit')['_onclick']
="ajax('{{=URL('set',args=5)}}',[],'')"

and serverside

def set():
   session.x=int(request.args(0))

On Nov 21, 4:47 am, Ishbir <[email protected]> wrote:
> Web2py uses server side sessions; so it is not possible to do this.
> What you can do, however, is call a controller function which sets the
> session variable.
>
> On Nov 21, 1:54 pm, beroz <[email protected]> wrote:
>
> > Hello,
>
> > How could I set value for a variable in session in javascript
> > function?
> > Example:
>
> >     image1.element(_type='submit')['_onclick'] ="javascript:
> > {{session.x = 5}}"
>
>

Reply via email to