Set a session variable in a link_to

I need to link_to a particular method in a particular controller that
needs to do something one time, from one page, and something
dfifferent another time, from another page.

I intend to set and subsequently get a session variable to do this.
This would require setting a session variable in the link_to code –
is there a way to do this? Thanks, Janna

link_to(“my link”, my_task_path, :special_needs => true)

That would give you params[:special_needs]

What are the actions maybe you should have different controllers?