0 votes
in Ruby by

What is the correct way to assign a value to the session?

 A.

$_SESSION['user_id'] = user.id

 B.

@session ||= Session.new << user.id

 C.

session_save(:user_id, user.id)

 D.

session[:user_id] = user.id

1 Answer

0 votes
by

What is the correct way to assign a value to the session?

Correct answer is :- session[:user_id] = user.id

Related questions

0 votes
asked Sep 3, 2022 in Ruby by DavidAnderson
0 votes
asked Sep 3, 2022 in Ruby by DavidAnderson
...