1

I have just uploaded Magento on localhost and its URL is simply this localhost/magento but when I go on its admin part i.e localhost/magento/admin part url redirects to a very complicated & unexpected url i.e http://localhost/magento/admin/admin/dashboard/index/key/d0635adba364ac457fb10aa4f6147b02c983c632402595b88482d7956d7accf0/.

Please help me out that how can overcome from this problem? I have earlier uploaded its previous version but then I have not face this type of problem but that I had uploaded directly on server not on localhost.

  • Does the admin login screen show? Are you able to login into the admin? – 7ochem Dec 4 '15 at 9:20
  • That is not a concern, Magento is just adding security key as part of URLs to make admin more secure. It is possible that you previously had it off, it is configurable via admin and on by default. – Prateek Dec 4 '15 at 9:35
  • yes I can login into the screen but the url showing is wierd i.e localhost/magento/admin/admin/crypt_key/index/key/… because i want to show it like localhost/magento/admin – Ashwani Kumar Dec 4 '15 at 9:47
2

Do not use localhost as the domain name. use 127.0.0.1 instead.
Magento is not able to set cookies unless there is a dot in the domain name.

The long number you see in the url is a security key generated based on the action name and a random session key. It is used to prevent CSRF attacks.

| improve this answer | |
  • can you please explain little here why ? we are learning from you post – Minesh Patel Dec 4 '15 at 9:17
  • @Marius, please elaborate more on your answer why you should use this... :P – 7ochem Dec 4 '15 at 9:21
  • @7ochem. Better now? – Marius Dec 4 '15 at 9:45
  • Wouw, very nice – 7ochem Dec 4 '15 at 9:53
0

It is a security key. Magento check it to know if it is from the current session or not.

If you want to disable it you can go in:
System > Configuration > Advanced > Admin > Security > Add secret key to URLs >> false.

But it is not really recommended.

| improve this answer | |
  • Thanks for your reply brother , I can only see "system" options as per your path in Backend so please clarify the path.I am using latest Magento so can you please elaborate your URL that from where i can overcome this problem. – Ashwani Kumar Dec 4 '15 at 10:02
  • @AshwaniKumar By default the "System" link is in the top menu of your admin far right. See screenshot here – Matthéo Geoffray Dec 4 '15 at 10:16
  • @geoffray have a look at this link prntscr.com/9a6mxo & prntscr.com/9a6ob7 from where i can see system n its option in different way , the view you are talking about may be of old version. – Ashwani Kumar Dec 4 '15 at 10:27
  • OK you are using Magento 2 ! The tag magento-1.9 mislead me sorry. I don't know where this configuration is on M2. But simple question, why do you want to disable this feature ? It very important to prevent against CSRF attacks. Not on a local environment of course but be careful if magento is for a production site. – Matthéo Geoffray Dec 4 '15 at 10:34
  • @geoffray Thanks but currently I am using it on localhost for learning purpose that's why I want to disable that URL so that I can understand these issues too. – Ashwani Kumar Dec 4 '15 at 10:51

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.