Last post Apr 14, 2018 10:59 AM by mgebhard
Apr 13, 2018 03:30 PM|Manu Samuel|LINK
public ActionResult Log_Out()
if (Session["CustomerID"] != null)
Session["RoleID"] = null;
Session["LogID"] = null;
Session["CustomerID"] = null;
Session["Name"] = null;
Html called like
<li><a href="~/User/Log_Out">Sign Out</a></li>
Apr 13, 2018 03:46 PM|mgebhard|LINK
Do you actually have a "Home" action in the current controller?
You probably need this overload where Index is the action to invoke and Home is the controller.
You can use Razor syntax too.
@Html.ActionLink("sign out", "log_out", "User", null, null)
Keep in mind, posting issues like "not working" is not descriptive enough to provide accurate assistance. Always describe what you are trying to do, what you expect to happen, and what actually happens.
Apr 13, 2018 04:00 PM|PatriceSc|LINK
Use F12 Network to see your query. You could call Session.Abandon() also. As pointed already when showing some code always tell what happens rather than what doesn't happen ;-)
Apr 14, 2018 02:41 AM|Manu Samuel|LINK
The code works even though is cleared the sessions and form authority of login when we click the back button on browser it goes to the last page from where it been logout.
Apr 14, 2018 10:59 AM|mgebhard|LINK
The browser is pulling the content from cache. Open the Network tab in your browser's Dev Tools to verify.
Apply this attribute to a controller to disable cache for the entire controller or to an action to disable cache for the action.
[OutputCacheAttribute(VaryByParam = "*", Duration = 0, NoStore = true)]
You can learn about cache by reading the docs.