2

Currently in our website we are using 1.) Session 2.) Cookie ; , they both have their own disadvantages. So, in our new website we don't want to use sessions and cookies.

We have googled and find some alternative ways of session and cookie as below:

1.) Use 'Local Storage 'or 'Session Storage'.

2.) Append data with the querystring.

Local storage is client side alternative to session. It will only be available to client script, not the server code, you would use it if you are writing a SPA and plan on making Ajax calls.

So, we need a alternative technical way to handle session and cookie with some other method.

Please help me regarding it .

sahil kaundal
  • 46
  • 1
  • 4

2 Answers2

1

Use 'Local Storage 'or 'Session Storage'.

Local Storage is not a replacement for Session State. They are totally different technologies.

Append data with the querystring.

QueryString is not a replacement for Session State either. We only use query string to pass very small data (normally integer value) between pages.

So, we need a alternative technical way to handle session and cookie with some other method.

Cookie

For ASP.Net MVC, you want to use Cookie for authentication unless you want to use Bearer Token. There is nothing wrong with using Cookie for authentication unless you abuse it.

Session State

In a nutshell, we do not need to use Session State directly in ASP.Net MVC. You can say that Session State and View State are somewhat replaced by Model if you will.

Keep in mind that TempData use Session State under the hood.

Win
  • 61,100
  • 13
  • 102
  • 181
0

I have googled to find some resources and trying to find out more, if anyone have suggestions please update.

2 ways to pass data between pages without using Session and Cookie:

1.) using Local Storage

2.) using Secure Query String:

====================================================

1.) using Local Storage:

a.) Local Storage or Session Storage:

What is the difference between localStorage, sessionStorage, session and cookies?

b.) HTML5 offline storage - Alternative to Session? [closed]

HTML5 offline storage - Alternative to Session?

Disadvantages: Are there any drawbacks to using localStorage instead of Cookies?

2.) using Secure Query String:

a.) MVC Encrypt Query String: Encrypting an id in an URL in ASP.NET MVC

b.) Securely Passing Identity Tokens Between Websites http://dotnetslackers.com/articles/aspnet/Securely-Passing-Identity-Tokens-Between-Websites.aspx#1776

c.) Encrypt and Decrypt URL in MVC 4

https://dotnettrace.net/2013/09/19/encrypt-and-decrypt-url-in-mvc-4/

Community
  • 1
  • 1
sahil kaundal
  • 46
  • 1
  • 4